{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Organizations.ListDelegatedServicesForAccount
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- List the Amazon Web Services services for which the specified account is
-- a delegated administrator.
--
-- This operation can be called only from the organization\'s management
-- account or by a member account that is a delegated administrator for an
-- Amazon Web Services service.
--
-- This operation returns paginated results.
module Amazonka.Organizations.ListDelegatedServicesForAccount
  ( -- * Creating a Request
    ListDelegatedServicesForAccount (..),
    newListDelegatedServicesForAccount,

    -- * Request Lenses
    listDelegatedServicesForAccount_maxResults,
    listDelegatedServicesForAccount_nextToken,
    listDelegatedServicesForAccount_accountId,

    -- * Destructuring the Response
    ListDelegatedServicesForAccountResponse (..),
    newListDelegatedServicesForAccountResponse,

    -- * Response Lenses
    listDelegatedServicesForAccountResponse_delegatedServices,
    listDelegatedServicesForAccountResponse_nextToken,
    listDelegatedServicesForAccountResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListDelegatedServicesForAccount' smart constructor.
data ListDelegatedServicesForAccount = ListDelegatedServicesForAccount'
  { -- | The total number of results that you want included on each page of the
    -- response. If you do not include this parameter, it defaults to a value
    -- that is specific to the operation. If additional items exist beyond the
    -- maximum you specify, the @NextToken@ response element is present and has
    -- a value (is not null). Include that value as the @NextToken@ request
    -- parameter in the next call to the operation to get the next part of the
    -- results. Note that Organizations might return fewer results than the
    -- maximum even when there are more results available. You should check
    -- @NextToken@ after every operation to ensure that you receive all of the
    -- results.
    ListDelegatedServicesForAccount -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The parameter for receiving additional results if you receive a
    -- @NextToken@ response in a previous request. A @NextToken@ response
    -- indicates that more output is available. Set this parameter to the value
    -- of the previous call\'s @NextToken@ response to indicate where the
    -- output should continue from.
    ListDelegatedServicesForAccount -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The account ID number of a delegated administrator account in the
    -- organization.
    ListDelegatedServicesForAccount -> Text
accountId :: Prelude.Text
  }
  deriving (ListDelegatedServicesForAccount
-> ListDelegatedServicesForAccount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDelegatedServicesForAccount
-> ListDelegatedServicesForAccount -> Bool
$c/= :: ListDelegatedServicesForAccount
-> ListDelegatedServicesForAccount -> Bool
== :: ListDelegatedServicesForAccount
-> ListDelegatedServicesForAccount -> Bool
$c== :: ListDelegatedServicesForAccount
-> ListDelegatedServicesForAccount -> Bool
Prelude.Eq, ReadPrec [ListDelegatedServicesForAccount]
ReadPrec ListDelegatedServicesForAccount
Int -> ReadS ListDelegatedServicesForAccount
ReadS [ListDelegatedServicesForAccount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDelegatedServicesForAccount]
$creadListPrec :: ReadPrec [ListDelegatedServicesForAccount]
readPrec :: ReadPrec ListDelegatedServicesForAccount
$creadPrec :: ReadPrec ListDelegatedServicesForAccount
readList :: ReadS [ListDelegatedServicesForAccount]
$creadList :: ReadS [ListDelegatedServicesForAccount]
readsPrec :: Int -> ReadS ListDelegatedServicesForAccount
$creadsPrec :: Int -> ReadS ListDelegatedServicesForAccount
Prelude.Read, Int -> ListDelegatedServicesForAccount -> ShowS
[ListDelegatedServicesForAccount] -> ShowS
ListDelegatedServicesForAccount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDelegatedServicesForAccount] -> ShowS
$cshowList :: [ListDelegatedServicesForAccount] -> ShowS
show :: ListDelegatedServicesForAccount -> String
$cshow :: ListDelegatedServicesForAccount -> String
showsPrec :: Int -> ListDelegatedServicesForAccount -> ShowS
$cshowsPrec :: Int -> ListDelegatedServicesForAccount -> ShowS
Prelude.Show, forall x.
Rep ListDelegatedServicesForAccount x
-> ListDelegatedServicesForAccount
forall x.
ListDelegatedServicesForAccount
-> Rep ListDelegatedServicesForAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDelegatedServicesForAccount x
-> ListDelegatedServicesForAccount
$cfrom :: forall x.
ListDelegatedServicesForAccount
-> Rep ListDelegatedServicesForAccount x
Prelude.Generic)

-- |
-- Create a value of 'ListDelegatedServicesForAccount' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'maxResults', 'listDelegatedServicesForAccount_maxResults' - The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
--
-- 'nextToken', 'listDelegatedServicesForAccount_nextToken' - The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
--
-- 'accountId', 'listDelegatedServicesForAccount_accountId' - The account ID number of a delegated administrator account in the
-- organization.
newListDelegatedServicesForAccount ::
  -- | 'accountId'
  Prelude.Text ->
  ListDelegatedServicesForAccount
newListDelegatedServicesForAccount :: Text -> ListDelegatedServicesForAccount
newListDelegatedServicesForAccount Text
pAccountId_ =
  ListDelegatedServicesForAccount'
    { $sel:maxResults:ListDelegatedServicesForAccount' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDelegatedServicesForAccount' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:ListDelegatedServicesForAccount' :: Text
accountId = Text
pAccountId_
    }

-- | The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
listDelegatedServicesForAccount_maxResults :: Lens.Lens' ListDelegatedServicesForAccount (Prelude.Maybe Prelude.Natural)
listDelegatedServicesForAccount_maxResults :: Lens' ListDelegatedServicesForAccount (Maybe Natural)
listDelegatedServicesForAccount_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedServicesForAccount' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDelegatedServicesForAccount
s@ListDelegatedServicesForAccount' {} Maybe Natural
a -> ListDelegatedServicesForAccount
s {$sel:maxResults:ListDelegatedServicesForAccount' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDelegatedServicesForAccount)

-- | The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
listDelegatedServicesForAccount_nextToken :: Lens.Lens' ListDelegatedServicesForAccount (Prelude.Maybe Prelude.Text)
listDelegatedServicesForAccount_nextToken :: Lens' ListDelegatedServicesForAccount (Maybe Text)
listDelegatedServicesForAccount_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedServicesForAccount' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDelegatedServicesForAccount
s@ListDelegatedServicesForAccount' {} Maybe Text
a -> ListDelegatedServicesForAccount
s {$sel:nextToken:ListDelegatedServicesForAccount' :: Maybe Text
nextToken = Maybe Text
a} :: ListDelegatedServicesForAccount)

-- | The account ID number of a delegated administrator account in the
-- organization.
listDelegatedServicesForAccount_accountId :: Lens.Lens' ListDelegatedServicesForAccount Prelude.Text
listDelegatedServicesForAccount_accountId :: Lens' ListDelegatedServicesForAccount Text
listDelegatedServicesForAccount_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedServicesForAccount' {Text
accountId :: Text
$sel:accountId:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Text
accountId} -> Text
accountId) (\s :: ListDelegatedServicesForAccount
s@ListDelegatedServicesForAccount' {} Text
a -> ListDelegatedServicesForAccount
s {$sel:accountId:ListDelegatedServicesForAccount' :: Text
accountId = Text
a} :: ListDelegatedServicesForAccount)

instance
  Core.AWSPager
    ListDelegatedServicesForAccount
  where
  page :: ListDelegatedServicesForAccount
-> AWSResponse ListDelegatedServicesForAccount
-> Maybe ListDelegatedServicesForAccount
page ListDelegatedServicesForAccount
rq AWSResponse ListDelegatedServicesForAccount
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDelegatedServicesForAccount
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDelegatedServicesForAccountResponse (Maybe Text)
listDelegatedServicesForAccountResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDelegatedServicesForAccount
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListDelegatedServicesForAccountResponse (Maybe [DelegatedService])
listDelegatedServicesForAccountResponse_delegatedServices
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListDelegatedServicesForAccount
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDelegatedServicesForAccount (Maybe Text)
listDelegatedServicesForAccount_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDelegatedServicesForAccount
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDelegatedServicesForAccountResponse (Maybe Text)
listDelegatedServicesForAccountResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    ListDelegatedServicesForAccount
  where
  type
    AWSResponse ListDelegatedServicesForAccount =
      ListDelegatedServicesForAccountResponse
  request :: (Service -> Service)
-> ListDelegatedServicesForAccount
-> Request ListDelegatedServicesForAccount
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDelegatedServicesForAccount
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ListDelegatedServicesForAccount)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [DelegatedService]
-> Maybe Text -> Int -> ListDelegatedServicesForAccountResponse
ListDelegatedServicesForAccountResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DelegatedServices"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListDelegatedServicesForAccount
  where
  hashWithSalt :: Int -> ListDelegatedServicesForAccount -> Int
hashWithSalt
    Int
_salt
    ListDelegatedServicesForAccount' {Maybe Natural
Maybe Text
Text
accountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:accountId:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Text
$sel:nextToken:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Text
$sel:maxResults:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId

instance
  Prelude.NFData
    ListDelegatedServicesForAccount
  where
  rnf :: ListDelegatedServicesForAccount -> ()
rnf ListDelegatedServicesForAccount' {Maybe Natural
Maybe Text
Text
accountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:accountId:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Text
$sel:nextToken:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Text
$sel:maxResults:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
accountId

instance
  Data.ToHeaders
    ListDelegatedServicesForAccount
  where
  toHeaders :: ListDelegatedServicesForAccount -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSOrganizationsV20161128.ListDelegatedServicesForAccount" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListDelegatedServicesForAccount where
  toJSON :: ListDelegatedServicesForAccount -> Value
toJSON ListDelegatedServicesForAccount' {Maybe Natural
Maybe Text
Text
accountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:accountId:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Text
$sel:nextToken:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Text
$sel:maxResults:ListDelegatedServicesForAccount' :: ListDelegatedServicesForAccount -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"AccountId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
accountId)
          ]
      )

instance Data.ToPath ListDelegatedServicesForAccount where
  toPath :: ListDelegatedServicesForAccount -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListDelegatedServicesForAccount where
  toQuery :: ListDelegatedServicesForAccount -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListDelegatedServicesForAccountResponse' smart constructor.
data ListDelegatedServicesForAccountResponse = ListDelegatedServicesForAccountResponse'
  { -- | The services for which the account is a delegated administrator.
    ListDelegatedServicesForAccountResponse -> Maybe [DelegatedService]
delegatedServices :: Prelude.Maybe [DelegatedService],
    -- | If present, indicates that more output is available than is included in
    -- the current response. Use this value in the @NextToken@ request
    -- parameter in a subsequent call to the operation to get the next part of
    -- the output. You should repeat this until the @NextToken@ response
    -- element comes back as @null@.
    ListDelegatedServicesForAccountResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDelegatedServicesForAccountResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDelegatedServicesForAccountResponse
-> ListDelegatedServicesForAccountResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDelegatedServicesForAccountResponse
-> ListDelegatedServicesForAccountResponse -> Bool
$c/= :: ListDelegatedServicesForAccountResponse
-> ListDelegatedServicesForAccountResponse -> Bool
== :: ListDelegatedServicesForAccountResponse
-> ListDelegatedServicesForAccountResponse -> Bool
$c== :: ListDelegatedServicesForAccountResponse
-> ListDelegatedServicesForAccountResponse -> Bool
Prelude.Eq, ReadPrec [ListDelegatedServicesForAccountResponse]
ReadPrec ListDelegatedServicesForAccountResponse
Int -> ReadS ListDelegatedServicesForAccountResponse
ReadS [ListDelegatedServicesForAccountResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDelegatedServicesForAccountResponse]
$creadListPrec :: ReadPrec [ListDelegatedServicesForAccountResponse]
readPrec :: ReadPrec ListDelegatedServicesForAccountResponse
$creadPrec :: ReadPrec ListDelegatedServicesForAccountResponse
readList :: ReadS [ListDelegatedServicesForAccountResponse]
$creadList :: ReadS [ListDelegatedServicesForAccountResponse]
readsPrec :: Int -> ReadS ListDelegatedServicesForAccountResponse
$creadsPrec :: Int -> ReadS ListDelegatedServicesForAccountResponse
Prelude.Read, Int -> ListDelegatedServicesForAccountResponse -> ShowS
[ListDelegatedServicesForAccountResponse] -> ShowS
ListDelegatedServicesForAccountResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDelegatedServicesForAccountResponse] -> ShowS
$cshowList :: [ListDelegatedServicesForAccountResponse] -> ShowS
show :: ListDelegatedServicesForAccountResponse -> String
$cshow :: ListDelegatedServicesForAccountResponse -> String
showsPrec :: Int -> ListDelegatedServicesForAccountResponse -> ShowS
$cshowsPrec :: Int -> ListDelegatedServicesForAccountResponse -> ShowS
Prelude.Show, forall x.
Rep ListDelegatedServicesForAccountResponse x
-> ListDelegatedServicesForAccountResponse
forall x.
ListDelegatedServicesForAccountResponse
-> Rep ListDelegatedServicesForAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDelegatedServicesForAccountResponse x
-> ListDelegatedServicesForAccountResponse
$cfrom :: forall x.
ListDelegatedServicesForAccountResponse
-> Rep ListDelegatedServicesForAccountResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDelegatedServicesForAccountResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'delegatedServices', 'listDelegatedServicesForAccountResponse_delegatedServices' - The services for which the account is a delegated administrator.
--
-- 'nextToken', 'listDelegatedServicesForAccountResponse_nextToken' - If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
--
-- 'httpStatus', 'listDelegatedServicesForAccountResponse_httpStatus' - The response's http status code.
newListDelegatedServicesForAccountResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDelegatedServicesForAccountResponse
newListDelegatedServicesForAccountResponse :: Int -> ListDelegatedServicesForAccountResponse
newListDelegatedServicesForAccountResponse
  Int
pHttpStatus_ =
    ListDelegatedServicesForAccountResponse'
      { $sel:delegatedServices:ListDelegatedServicesForAccountResponse' :: Maybe [DelegatedService]
delegatedServices =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListDelegatedServicesForAccountResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListDelegatedServicesForAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The services for which the account is a delegated administrator.
listDelegatedServicesForAccountResponse_delegatedServices :: Lens.Lens' ListDelegatedServicesForAccountResponse (Prelude.Maybe [DelegatedService])
listDelegatedServicesForAccountResponse_delegatedServices :: Lens'
  ListDelegatedServicesForAccountResponse (Maybe [DelegatedService])
listDelegatedServicesForAccountResponse_delegatedServices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedServicesForAccountResponse' {Maybe [DelegatedService]
delegatedServices :: Maybe [DelegatedService]
$sel:delegatedServices:ListDelegatedServicesForAccountResponse' :: ListDelegatedServicesForAccountResponse -> Maybe [DelegatedService]
delegatedServices} -> Maybe [DelegatedService]
delegatedServices) (\s :: ListDelegatedServicesForAccountResponse
s@ListDelegatedServicesForAccountResponse' {} Maybe [DelegatedService]
a -> ListDelegatedServicesForAccountResponse
s {$sel:delegatedServices:ListDelegatedServicesForAccountResponse' :: Maybe [DelegatedService]
delegatedServices = Maybe [DelegatedService]
a} :: ListDelegatedServicesForAccountResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
listDelegatedServicesForAccountResponse_nextToken :: Lens.Lens' ListDelegatedServicesForAccountResponse (Prelude.Maybe Prelude.Text)
listDelegatedServicesForAccountResponse_nextToken :: Lens' ListDelegatedServicesForAccountResponse (Maybe Text)
listDelegatedServicesForAccountResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedServicesForAccountResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDelegatedServicesForAccountResponse' :: ListDelegatedServicesForAccountResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDelegatedServicesForAccountResponse
s@ListDelegatedServicesForAccountResponse' {} Maybe Text
a -> ListDelegatedServicesForAccountResponse
s {$sel:nextToken:ListDelegatedServicesForAccountResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDelegatedServicesForAccountResponse)

-- | The response's http status code.
listDelegatedServicesForAccountResponse_httpStatus :: Lens.Lens' ListDelegatedServicesForAccountResponse Prelude.Int
listDelegatedServicesForAccountResponse_httpStatus :: Lens' ListDelegatedServicesForAccountResponse Int
listDelegatedServicesForAccountResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedServicesForAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDelegatedServicesForAccountResponse' :: ListDelegatedServicesForAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDelegatedServicesForAccountResponse
s@ListDelegatedServicesForAccountResponse' {} Int
a -> ListDelegatedServicesForAccountResponse
s {$sel:httpStatus:ListDelegatedServicesForAccountResponse' :: Int
httpStatus = Int
a} :: ListDelegatedServicesForAccountResponse)

instance
  Prelude.NFData
    ListDelegatedServicesForAccountResponse
  where
  rnf :: ListDelegatedServicesForAccountResponse -> ()
rnf ListDelegatedServicesForAccountResponse' {Int
Maybe [DelegatedService]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
delegatedServices :: Maybe [DelegatedService]
$sel:httpStatus:ListDelegatedServicesForAccountResponse' :: ListDelegatedServicesForAccountResponse -> Int
$sel:nextToken:ListDelegatedServicesForAccountResponse' :: ListDelegatedServicesForAccountResponse -> Maybe Text
$sel:delegatedServices:ListDelegatedServicesForAccountResponse' :: ListDelegatedServicesForAccountResponse -> Maybe [DelegatedService]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DelegatedService]
delegatedServices
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus