{-# 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.ListDelegatedAdministrators
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the Amazon Web Services accounts that are designated as delegated
-- administrators in this organization.
--
-- 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.ListDelegatedAdministrators
  ( -- * Creating a Request
    ListDelegatedAdministrators (..),
    newListDelegatedAdministrators,

    -- * Request Lenses
    listDelegatedAdministrators_maxResults,
    listDelegatedAdministrators_nextToken,
    listDelegatedAdministrators_servicePrincipal,

    -- * Destructuring the Response
    ListDelegatedAdministratorsResponse (..),
    newListDelegatedAdministratorsResponse,

    -- * Response Lenses
    listDelegatedAdministratorsResponse_delegatedAdministrators,
    listDelegatedAdministratorsResponse_nextToken,
    listDelegatedAdministratorsResponse_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:/ 'newListDelegatedAdministrators' smart constructor.
data ListDelegatedAdministrators = ListDelegatedAdministrators'
  { -- | 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.
    ListDelegatedAdministrators -> 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.
    ListDelegatedAdministrators -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies a service principal name. If specified, then the operation
    -- lists the delegated administrators only for the specified service.
    --
    -- If you don\'t specify a service principal, the operation lists all
    -- delegated administrators for all services in your organization.
    ListDelegatedAdministrators -> Maybe Text
servicePrincipal :: Prelude.Maybe Prelude.Text
  }
  deriving (ListDelegatedAdministrators -> ListDelegatedAdministrators -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDelegatedAdministrators -> ListDelegatedAdministrators -> Bool
$c/= :: ListDelegatedAdministrators -> ListDelegatedAdministrators -> Bool
== :: ListDelegatedAdministrators -> ListDelegatedAdministrators -> Bool
$c== :: ListDelegatedAdministrators -> ListDelegatedAdministrators -> Bool
Prelude.Eq, ReadPrec [ListDelegatedAdministrators]
ReadPrec ListDelegatedAdministrators
Int -> ReadS ListDelegatedAdministrators
ReadS [ListDelegatedAdministrators]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDelegatedAdministrators]
$creadListPrec :: ReadPrec [ListDelegatedAdministrators]
readPrec :: ReadPrec ListDelegatedAdministrators
$creadPrec :: ReadPrec ListDelegatedAdministrators
readList :: ReadS [ListDelegatedAdministrators]
$creadList :: ReadS [ListDelegatedAdministrators]
readsPrec :: Int -> ReadS ListDelegatedAdministrators
$creadsPrec :: Int -> ReadS ListDelegatedAdministrators
Prelude.Read, Int -> ListDelegatedAdministrators -> ShowS
[ListDelegatedAdministrators] -> ShowS
ListDelegatedAdministrators -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDelegatedAdministrators] -> ShowS
$cshowList :: [ListDelegatedAdministrators] -> ShowS
show :: ListDelegatedAdministrators -> String
$cshow :: ListDelegatedAdministrators -> String
showsPrec :: Int -> ListDelegatedAdministrators -> ShowS
$cshowsPrec :: Int -> ListDelegatedAdministrators -> ShowS
Prelude.Show, forall x.
Rep ListDelegatedAdministrators x -> ListDelegatedAdministrators
forall x.
ListDelegatedAdministrators -> Rep ListDelegatedAdministrators x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDelegatedAdministrators x -> ListDelegatedAdministrators
$cfrom :: forall x.
ListDelegatedAdministrators -> Rep ListDelegatedAdministrators x
Prelude.Generic)

-- |
-- Create a value of 'ListDelegatedAdministrators' 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', 'listDelegatedAdministrators_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', 'listDelegatedAdministrators_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.
--
-- 'servicePrincipal', 'listDelegatedAdministrators_servicePrincipal' - Specifies a service principal name. If specified, then the operation
-- lists the delegated administrators only for the specified service.
--
-- If you don\'t specify a service principal, the operation lists all
-- delegated administrators for all services in your organization.
newListDelegatedAdministrators ::
  ListDelegatedAdministrators
newListDelegatedAdministrators :: ListDelegatedAdministrators
newListDelegatedAdministrators =
  ListDelegatedAdministrators'
    { $sel:maxResults:ListDelegatedAdministrators' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDelegatedAdministrators' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:servicePrincipal:ListDelegatedAdministrators' :: Maybe Text
servicePrincipal = forall a. Maybe a
Prelude.Nothing
    }

-- | 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.
listDelegatedAdministrators_maxResults :: Lens.Lens' ListDelegatedAdministrators (Prelude.Maybe Prelude.Natural)
listDelegatedAdministrators_maxResults :: Lens' ListDelegatedAdministrators (Maybe Natural)
listDelegatedAdministrators_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedAdministrators' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDelegatedAdministrators
s@ListDelegatedAdministrators' {} Maybe Natural
a -> ListDelegatedAdministrators
s {$sel:maxResults:ListDelegatedAdministrators' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDelegatedAdministrators)

-- | 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.
listDelegatedAdministrators_nextToken :: Lens.Lens' ListDelegatedAdministrators (Prelude.Maybe Prelude.Text)
listDelegatedAdministrators_nextToken :: Lens' ListDelegatedAdministrators (Maybe Text)
listDelegatedAdministrators_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedAdministrators' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDelegatedAdministrators
s@ListDelegatedAdministrators' {} Maybe Text
a -> ListDelegatedAdministrators
s {$sel:nextToken:ListDelegatedAdministrators' :: Maybe Text
nextToken = Maybe Text
a} :: ListDelegatedAdministrators)

-- | Specifies a service principal name. If specified, then the operation
-- lists the delegated administrators only for the specified service.
--
-- If you don\'t specify a service principal, the operation lists all
-- delegated administrators for all services in your organization.
listDelegatedAdministrators_servicePrincipal :: Lens.Lens' ListDelegatedAdministrators (Prelude.Maybe Prelude.Text)
listDelegatedAdministrators_servicePrincipal :: Lens' ListDelegatedAdministrators (Maybe Text)
listDelegatedAdministrators_servicePrincipal = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedAdministrators' {Maybe Text
servicePrincipal :: Maybe Text
$sel:servicePrincipal:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
servicePrincipal} -> Maybe Text
servicePrincipal) (\s :: ListDelegatedAdministrators
s@ListDelegatedAdministrators' {} Maybe Text
a -> ListDelegatedAdministrators
s {$sel:servicePrincipal:ListDelegatedAdministrators' :: Maybe Text
servicePrincipal = Maybe Text
a} :: ListDelegatedAdministrators)

instance Core.AWSPager ListDelegatedAdministrators where
  page :: ListDelegatedAdministrators
-> AWSResponse ListDelegatedAdministrators
-> Maybe ListDelegatedAdministrators
page ListDelegatedAdministrators
rq AWSResponse ListDelegatedAdministrators
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDelegatedAdministrators
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDelegatedAdministratorsResponse (Maybe Text)
listDelegatedAdministratorsResponse_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 ListDelegatedAdministrators
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListDelegatedAdministratorsResponse
  (Maybe [DelegatedAdministrator])
listDelegatedAdministratorsResponse_delegatedAdministrators
            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.$ ListDelegatedAdministrators
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDelegatedAdministrators (Maybe Text)
listDelegatedAdministrators_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDelegatedAdministrators
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDelegatedAdministratorsResponse (Maybe Text)
listDelegatedAdministratorsResponse_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 ListDelegatedAdministrators where
  type
    AWSResponse ListDelegatedAdministrators =
      ListDelegatedAdministratorsResponse
  request :: (Service -> Service)
-> ListDelegatedAdministrators
-> Request ListDelegatedAdministrators
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 ListDelegatedAdministrators
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDelegatedAdministrators)))
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 [DelegatedAdministrator]
-> Maybe Text -> Int -> ListDelegatedAdministratorsResponse
ListDelegatedAdministratorsResponse'
            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
"DelegatedAdministrators"
                            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 ListDelegatedAdministrators where
  hashWithSalt :: Int -> ListDelegatedAdministrators -> Int
hashWithSalt Int
_salt ListDelegatedAdministrators' {Maybe Natural
Maybe Text
servicePrincipal :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:servicePrincipal:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
$sel:nextToken:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
$sel:maxResults:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> 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` Maybe Text
servicePrincipal

instance Prelude.NFData ListDelegatedAdministrators where
  rnf :: ListDelegatedAdministrators -> ()
rnf ListDelegatedAdministrators' {Maybe Natural
Maybe Text
servicePrincipal :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:servicePrincipal:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
$sel:nextToken:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
$sel:maxResults:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> 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 Maybe Text
servicePrincipal

instance Data.ToHeaders ListDelegatedAdministrators where
  toHeaders :: ListDelegatedAdministrators -> 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.ListDelegatedAdministrators" ::
                          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 ListDelegatedAdministrators where
  toJSON :: ListDelegatedAdministrators -> Value
toJSON ListDelegatedAdministrators' {Maybe Natural
Maybe Text
servicePrincipal :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:servicePrincipal:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
$sel:nextToken:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> Maybe Text
$sel:maxResults:ListDelegatedAdministrators' :: ListDelegatedAdministrators -> 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,
            (Key
"ServicePrincipal" 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
servicePrincipal
          ]
      )

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

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

-- | /See:/ 'newListDelegatedAdministratorsResponse' smart constructor.
data ListDelegatedAdministratorsResponse = ListDelegatedAdministratorsResponse'
  { -- | The list of delegated administrators in your organization.
    ListDelegatedAdministratorsResponse
-> Maybe [DelegatedAdministrator]
delegatedAdministrators :: Prelude.Maybe [DelegatedAdministrator],
    -- | 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@.
    ListDelegatedAdministratorsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDelegatedAdministratorsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDelegatedAdministratorsResponse
-> ListDelegatedAdministratorsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDelegatedAdministratorsResponse
-> ListDelegatedAdministratorsResponse -> Bool
$c/= :: ListDelegatedAdministratorsResponse
-> ListDelegatedAdministratorsResponse -> Bool
== :: ListDelegatedAdministratorsResponse
-> ListDelegatedAdministratorsResponse -> Bool
$c== :: ListDelegatedAdministratorsResponse
-> ListDelegatedAdministratorsResponse -> Bool
Prelude.Eq, Int -> ListDelegatedAdministratorsResponse -> ShowS
[ListDelegatedAdministratorsResponse] -> ShowS
ListDelegatedAdministratorsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDelegatedAdministratorsResponse] -> ShowS
$cshowList :: [ListDelegatedAdministratorsResponse] -> ShowS
show :: ListDelegatedAdministratorsResponse -> String
$cshow :: ListDelegatedAdministratorsResponse -> String
showsPrec :: Int -> ListDelegatedAdministratorsResponse -> ShowS
$cshowsPrec :: Int -> ListDelegatedAdministratorsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDelegatedAdministratorsResponse x
-> ListDelegatedAdministratorsResponse
forall x.
ListDelegatedAdministratorsResponse
-> Rep ListDelegatedAdministratorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDelegatedAdministratorsResponse x
-> ListDelegatedAdministratorsResponse
$cfrom :: forall x.
ListDelegatedAdministratorsResponse
-> Rep ListDelegatedAdministratorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDelegatedAdministratorsResponse' 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:
--
-- 'delegatedAdministrators', 'listDelegatedAdministratorsResponse_delegatedAdministrators' - The list of delegated administrators in your organization.
--
-- 'nextToken', 'listDelegatedAdministratorsResponse_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', 'listDelegatedAdministratorsResponse_httpStatus' - The response's http status code.
newListDelegatedAdministratorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDelegatedAdministratorsResponse
newListDelegatedAdministratorsResponse :: Int -> ListDelegatedAdministratorsResponse
newListDelegatedAdministratorsResponse Int
pHttpStatus_ =
  ListDelegatedAdministratorsResponse'
    { $sel:delegatedAdministrators:ListDelegatedAdministratorsResponse' :: Maybe [DelegatedAdministrator]
delegatedAdministrators =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDelegatedAdministratorsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDelegatedAdministratorsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of delegated administrators in your organization.
listDelegatedAdministratorsResponse_delegatedAdministrators :: Lens.Lens' ListDelegatedAdministratorsResponse (Prelude.Maybe [DelegatedAdministrator])
listDelegatedAdministratorsResponse_delegatedAdministrators :: Lens'
  ListDelegatedAdministratorsResponse
  (Maybe [DelegatedAdministrator])
listDelegatedAdministratorsResponse_delegatedAdministrators = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedAdministratorsResponse' {Maybe [DelegatedAdministrator]
delegatedAdministrators :: Maybe [DelegatedAdministrator]
$sel:delegatedAdministrators:ListDelegatedAdministratorsResponse' :: ListDelegatedAdministratorsResponse
-> Maybe [DelegatedAdministrator]
delegatedAdministrators} -> Maybe [DelegatedAdministrator]
delegatedAdministrators) (\s :: ListDelegatedAdministratorsResponse
s@ListDelegatedAdministratorsResponse' {} Maybe [DelegatedAdministrator]
a -> ListDelegatedAdministratorsResponse
s {$sel:delegatedAdministrators:ListDelegatedAdministratorsResponse' :: Maybe [DelegatedAdministrator]
delegatedAdministrators = Maybe [DelegatedAdministrator]
a} :: ListDelegatedAdministratorsResponse) 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@.
listDelegatedAdministratorsResponse_nextToken :: Lens.Lens' ListDelegatedAdministratorsResponse (Prelude.Maybe Prelude.Text)
listDelegatedAdministratorsResponse_nextToken :: Lens' ListDelegatedAdministratorsResponse (Maybe Text)
listDelegatedAdministratorsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDelegatedAdministratorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDelegatedAdministratorsResponse' :: ListDelegatedAdministratorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDelegatedAdministratorsResponse
s@ListDelegatedAdministratorsResponse' {} Maybe Text
a -> ListDelegatedAdministratorsResponse
s {$sel:nextToken:ListDelegatedAdministratorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDelegatedAdministratorsResponse)

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

instance
  Prelude.NFData
    ListDelegatedAdministratorsResponse
  where
  rnf :: ListDelegatedAdministratorsResponse -> ()
rnf ListDelegatedAdministratorsResponse' {Int
Maybe [DelegatedAdministrator]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
delegatedAdministrators :: Maybe [DelegatedAdministrator]
$sel:httpStatus:ListDelegatedAdministratorsResponse' :: ListDelegatedAdministratorsResponse -> Int
$sel:nextToken:ListDelegatedAdministratorsResponse' :: ListDelegatedAdministratorsResponse -> Maybe Text
$sel:delegatedAdministrators:ListDelegatedAdministratorsResponse' :: ListDelegatedAdministratorsResponse
-> Maybe [DelegatedAdministrator]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [DelegatedAdministrator]
delegatedAdministrators
      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