{-# 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.DirectoryService.DescribeDomainControllers
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides information about any domain controllers in your directory.
--
-- This operation returns paginated results.
module Amazonka.DirectoryService.DescribeDomainControllers
  ( -- * Creating a Request
    DescribeDomainControllers (..),
    newDescribeDomainControllers,

    -- * Request Lenses
    describeDomainControllers_nextToken,
    describeDomainControllers_domainControllerIds,
    describeDomainControllers_limit,
    describeDomainControllers_directoryId,

    -- * Destructuring the Response
    DescribeDomainControllersResponse (..),
    newDescribeDomainControllersResponse,

    -- * Response Lenses
    describeDomainControllersResponse_nextToken,
    describeDomainControllersResponse_domainControllers,
    describeDomainControllersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeDomainControllers' smart constructor.
data DescribeDomainControllers = DescribeDomainControllers'
  { -- | The /DescribeDomainControllers.NextToken/ value from a previous call to
    -- DescribeDomainControllers. Pass null if this is the first call.
    DescribeDomainControllers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of identifiers for the domain controllers whose information will
    -- be provided.
    DescribeDomainControllers -> Maybe [Text]
domainControllerIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of items to return.
    DescribeDomainControllers -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | Identifier of the directory for which to retrieve the domain controller
    -- information.
    DescribeDomainControllers -> Text
directoryId :: Prelude.Text
  }
  deriving (DescribeDomainControllers -> DescribeDomainControllers -> Bool
(DescribeDomainControllers -> DescribeDomainControllers -> Bool)
-> (DescribeDomainControllers -> DescribeDomainControllers -> Bool)
-> Eq DescribeDomainControllers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDomainControllers -> DescribeDomainControllers -> Bool
$c/= :: DescribeDomainControllers -> DescribeDomainControllers -> Bool
== :: DescribeDomainControllers -> DescribeDomainControllers -> Bool
$c== :: DescribeDomainControllers -> DescribeDomainControllers -> Bool
Prelude.Eq, ReadPrec [DescribeDomainControllers]
ReadPrec DescribeDomainControllers
Int -> ReadS DescribeDomainControllers
ReadS [DescribeDomainControllers]
(Int -> ReadS DescribeDomainControllers)
-> ReadS [DescribeDomainControllers]
-> ReadPrec DescribeDomainControllers
-> ReadPrec [DescribeDomainControllers]
-> Read DescribeDomainControllers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDomainControllers]
$creadListPrec :: ReadPrec [DescribeDomainControllers]
readPrec :: ReadPrec DescribeDomainControllers
$creadPrec :: ReadPrec DescribeDomainControllers
readList :: ReadS [DescribeDomainControllers]
$creadList :: ReadS [DescribeDomainControllers]
readsPrec :: Int -> ReadS DescribeDomainControllers
$creadsPrec :: Int -> ReadS DescribeDomainControllers
Prelude.Read, Int -> DescribeDomainControllers -> ShowS
[DescribeDomainControllers] -> ShowS
DescribeDomainControllers -> String
(Int -> DescribeDomainControllers -> ShowS)
-> (DescribeDomainControllers -> String)
-> ([DescribeDomainControllers] -> ShowS)
-> Show DescribeDomainControllers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDomainControllers] -> ShowS
$cshowList :: [DescribeDomainControllers] -> ShowS
show :: DescribeDomainControllers -> String
$cshow :: DescribeDomainControllers -> String
showsPrec :: Int -> DescribeDomainControllers -> ShowS
$cshowsPrec :: Int -> DescribeDomainControllers -> ShowS
Prelude.Show, (forall x.
 DescribeDomainControllers -> Rep DescribeDomainControllers x)
-> (forall x.
    Rep DescribeDomainControllers x -> DescribeDomainControllers)
-> Generic DescribeDomainControllers
forall x.
Rep DescribeDomainControllers x -> DescribeDomainControllers
forall x.
DescribeDomainControllers -> Rep DescribeDomainControllers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDomainControllers x -> DescribeDomainControllers
$cfrom :: forall x.
DescribeDomainControllers -> Rep DescribeDomainControllers x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDomainControllers' 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:
--
-- 'nextToken', 'describeDomainControllers_nextToken' - The /DescribeDomainControllers.NextToken/ value from a previous call to
-- DescribeDomainControllers. Pass null if this is the first call.
--
-- 'domainControllerIds', 'describeDomainControllers_domainControllerIds' - A list of identifiers for the domain controllers whose information will
-- be provided.
--
-- 'limit', 'describeDomainControllers_limit' - The maximum number of items to return.
--
-- 'directoryId', 'describeDomainControllers_directoryId' - Identifier of the directory for which to retrieve the domain controller
-- information.
newDescribeDomainControllers ::
  -- | 'directoryId'
  Prelude.Text ->
  DescribeDomainControllers
newDescribeDomainControllers :: Text -> DescribeDomainControllers
newDescribeDomainControllers Text
pDirectoryId_ =
  DescribeDomainControllers' :: Maybe Text
-> Maybe [Text]
-> Maybe Natural
-> Text
-> DescribeDomainControllers
DescribeDomainControllers'
    { $sel:nextToken:DescribeDomainControllers' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainControllerIds:DescribeDomainControllers' :: Maybe [Text]
domainControllerIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeDomainControllers' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:directoryId:DescribeDomainControllers' :: Text
directoryId = Text
pDirectoryId_
    }

-- | The /DescribeDomainControllers.NextToken/ value from a previous call to
-- DescribeDomainControllers. Pass null if this is the first call.
describeDomainControllers_nextToken :: Lens.Lens' DescribeDomainControllers (Prelude.Maybe Prelude.Text)
describeDomainControllers_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDomainControllers -> f DescribeDomainControllers
describeDomainControllers_nextToken = (DescribeDomainControllers -> Maybe Text)
-> (DescribeDomainControllers
    -> Maybe Text -> DescribeDomainControllers)
-> Lens
     DescribeDomainControllers
     DescribeDomainControllers
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainControllers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDomainControllers' :: DescribeDomainControllers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDomainControllers
s@DescribeDomainControllers' {} Maybe Text
a -> DescribeDomainControllers
s {$sel:nextToken:DescribeDomainControllers' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDomainControllers)

-- | A list of identifiers for the domain controllers whose information will
-- be provided.
describeDomainControllers_domainControllerIds :: Lens.Lens' DescribeDomainControllers (Prelude.Maybe [Prelude.Text])
describeDomainControllers_domainControllerIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeDomainControllers -> f DescribeDomainControllers
describeDomainControllers_domainControllerIds = (DescribeDomainControllers -> Maybe [Text])
-> (DescribeDomainControllers
    -> Maybe [Text] -> DescribeDomainControllers)
-> Lens
     DescribeDomainControllers
     DescribeDomainControllers
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainControllers' {Maybe [Text]
domainControllerIds :: Maybe [Text]
$sel:domainControllerIds:DescribeDomainControllers' :: DescribeDomainControllers -> Maybe [Text]
domainControllerIds} -> Maybe [Text]
domainControllerIds) (\s :: DescribeDomainControllers
s@DescribeDomainControllers' {} Maybe [Text]
a -> DescribeDomainControllers
s {$sel:domainControllerIds:DescribeDomainControllers' :: Maybe [Text]
domainControllerIds = Maybe [Text]
a} :: DescribeDomainControllers) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeDomainControllers -> f DescribeDomainControllers)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeDomainControllers
-> f DescribeDomainControllers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of items to return.
describeDomainControllers_limit :: Lens.Lens' DescribeDomainControllers (Prelude.Maybe Prelude.Natural)
describeDomainControllers_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeDomainControllers -> f DescribeDomainControllers
describeDomainControllers_limit = (DescribeDomainControllers -> Maybe Natural)
-> (DescribeDomainControllers
    -> Maybe Natural -> DescribeDomainControllers)
-> Lens
     DescribeDomainControllers
     DescribeDomainControllers
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainControllers' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeDomainControllers' :: DescribeDomainControllers -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeDomainControllers
s@DescribeDomainControllers' {} Maybe Natural
a -> DescribeDomainControllers
s {$sel:limit:DescribeDomainControllers' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeDomainControllers)

-- | Identifier of the directory for which to retrieve the domain controller
-- information.
describeDomainControllers_directoryId :: Lens.Lens' DescribeDomainControllers Prelude.Text
describeDomainControllers_directoryId :: (Text -> f Text)
-> DescribeDomainControllers -> f DescribeDomainControllers
describeDomainControllers_directoryId = (DescribeDomainControllers -> Text)
-> (DescribeDomainControllers -> Text -> DescribeDomainControllers)
-> Lens
     DescribeDomainControllers DescribeDomainControllers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainControllers' {Text
directoryId :: Text
$sel:directoryId:DescribeDomainControllers' :: DescribeDomainControllers -> Text
directoryId} -> Text
directoryId) (\s :: DescribeDomainControllers
s@DescribeDomainControllers' {} Text
a -> DescribeDomainControllers
s {$sel:directoryId:DescribeDomainControllers' :: Text
directoryId = Text
a} :: DescribeDomainControllers)

instance Core.AWSPager DescribeDomainControllers where
  page :: DescribeDomainControllers
-> AWSResponse DescribeDomainControllers
-> Maybe DescribeDomainControllers
page DescribeDomainControllers
rq AWSResponse DescribeDomainControllers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDomainControllers
DescribeDomainControllersResponse
rs
            DescribeDomainControllersResponse
-> Getting (First Text) DescribeDomainControllersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDomainControllersResponse
-> Const (First Text) DescribeDomainControllersResponse
Lens' DescribeDomainControllersResponse (Maybe Text)
describeDomainControllersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeDomainControllersResponse
 -> Const (First Text) DescribeDomainControllersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDomainControllersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeDomainControllers
forall a. Maybe a
Prelude.Nothing
    | Maybe [DomainController] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeDomainControllers
DescribeDomainControllersResponse
rs
            DescribeDomainControllersResponse
-> Getting
     (First [DomainController])
     DescribeDomainControllersResponse
     [DomainController]
-> Maybe [DomainController]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DomainController]
 -> Const (First [DomainController]) (Maybe [DomainController]))
-> DescribeDomainControllersResponse
-> Const
     (First [DomainController]) DescribeDomainControllersResponse
Lens' DescribeDomainControllersResponse (Maybe [DomainController])
describeDomainControllersResponse_domainControllers
              ((Maybe [DomainController]
  -> Const (First [DomainController]) (Maybe [DomainController]))
 -> DescribeDomainControllersResponse
 -> Const
      (First [DomainController]) DescribeDomainControllersResponse)
-> (([DomainController]
     -> Const (First [DomainController]) [DomainController])
    -> Maybe [DomainController]
    -> Const (First [DomainController]) (Maybe [DomainController]))
-> Getting
     (First [DomainController])
     DescribeDomainControllersResponse
     [DomainController]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DomainController]
 -> Const (First [DomainController]) [DomainController])
-> Maybe [DomainController]
-> Const (First [DomainController]) (Maybe [DomainController])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeDomainControllers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeDomainControllers -> Maybe DescribeDomainControllers
forall a. a -> Maybe a
Prelude.Just (DescribeDomainControllers -> Maybe DescribeDomainControllers)
-> DescribeDomainControllers -> Maybe DescribeDomainControllers
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeDomainControllers
rq
          DescribeDomainControllers
-> (DescribeDomainControllers -> DescribeDomainControllers)
-> DescribeDomainControllers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeDomainControllers -> Identity DescribeDomainControllers
Lens
  DescribeDomainControllers
  DescribeDomainControllers
  (Maybe Text)
  (Maybe Text)
describeDomainControllers_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeDomainControllers -> Identity DescribeDomainControllers)
-> Maybe Text
-> DescribeDomainControllers
-> DescribeDomainControllers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeDomainControllers
DescribeDomainControllersResponse
rs
          DescribeDomainControllersResponse
-> Getting (First Text) DescribeDomainControllersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeDomainControllersResponse
-> Const (First Text) DescribeDomainControllersResponse
Lens' DescribeDomainControllersResponse (Maybe Text)
describeDomainControllersResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeDomainControllersResponse
 -> Const (First Text) DescribeDomainControllersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeDomainControllersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.Hashable DescribeDomainControllers

instance Prelude.NFData DescribeDomainControllers

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

instance Core.ToJSON DescribeDomainControllers where
  toJSON :: DescribeDomainControllers -> Value
toJSON DescribeDomainControllers' {Maybe Natural
Maybe [Text]
Maybe Text
Text
directoryId :: Text
limit :: Maybe Natural
domainControllerIds :: Maybe [Text]
nextToken :: Maybe Text
$sel:directoryId:DescribeDomainControllers' :: DescribeDomainControllers -> Text
$sel:limit:DescribeDomainControllers' :: DescribeDomainControllers -> Maybe Natural
$sel:domainControllerIds:DescribeDomainControllers' :: DescribeDomainControllers -> Maybe [Text]
$sel:nextToken:DescribeDomainControllers' :: DescribeDomainControllers -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"DomainControllerIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
domainControllerIds,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId)
          ]
      )

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

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

-- | /See:/ 'newDescribeDomainControllersResponse' smart constructor.
data DescribeDomainControllersResponse = DescribeDomainControllersResponse'
  { -- | If not null, more results are available. Pass this value for the
    -- @NextToken@ parameter in a subsequent call to DescribeDomainControllers
    -- retrieve the next set of items.
    DescribeDomainControllersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of the DomainController objects that were retrieved.
    DescribeDomainControllersResponse -> Maybe [DomainController]
domainControllers :: Prelude.Maybe [DomainController],
    -- | The response's http status code.
    DescribeDomainControllersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDomainControllersResponse
-> DescribeDomainControllersResponse -> Bool
(DescribeDomainControllersResponse
 -> DescribeDomainControllersResponse -> Bool)
-> (DescribeDomainControllersResponse
    -> DescribeDomainControllersResponse -> Bool)
-> Eq DescribeDomainControllersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDomainControllersResponse
-> DescribeDomainControllersResponse -> Bool
$c/= :: DescribeDomainControllersResponse
-> DescribeDomainControllersResponse -> Bool
== :: DescribeDomainControllersResponse
-> DescribeDomainControllersResponse -> Bool
$c== :: DescribeDomainControllersResponse
-> DescribeDomainControllersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDomainControllersResponse]
ReadPrec DescribeDomainControllersResponse
Int -> ReadS DescribeDomainControllersResponse
ReadS [DescribeDomainControllersResponse]
(Int -> ReadS DescribeDomainControllersResponse)
-> ReadS [DescribeDomainControllersResponse]
-> ReadPrec DescribeDomainControllersResponse
-> ReadPrec [DescribeDomainControllersResponse]
-> Read DescribeDomainControllersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDomainControllersResponse]
$creadListPrec :: ReadPrec [DescribeDomainControllersResponse]
readPrec :: ReadPrec DescribeDomainControllersResponse
$creadPrec :: ReadPrec DescribeDomainControllersResponse
readList :: ReadS [DescribeDomainControllersResponse]
$creadList :: ReadS [DescribeDomainControllersResponse]
readsPrec :: Int -> ReadS DescribeDomainControllersResponse
$creadsPrec :: Int -> ReadS DescribeDomainControllersResponse
Prelude.Read, Int -> DescribeDomainControllersResponse -> ShowS
[DescribeDomainControllersResponse] -> ShowS
DescribeDomainControllersResponse -> String
(Int -> DescribeDomainControllersResponse -> ShowS)
-> (DescribeDomainControllersResponse -> String)
-> ([DescribeDomainControllersResponse] -> ShowS)
-> Show DescribeDomainControllersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDomainControllersResponse] -> ShowS
$cshowList :: [DescribeDomainControllersResponse] -> ShowS
show :: DescribeDomainControllersResponse -> String
$cshow :: DescribeDomainControllersResponse -> String
showsPrec :: Int -> DescribeDomainControllersResponse -> ShowS
$cshowsPrec :: Int -> DescribeDomainControllersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDomainControllersResponse
 -> Rep DescribeDomainControllersResponse x)
-> (forall x.
    Rep DescribeDomainControllersResponse x
    -> DescribeDomainControllersResponse)
-> Generic DescribeDomainControllersResponse
forall x.
Rep DescribeDomainControllersResponse x
-> DescribeDomainControllersResponse
forall x.
DescribeDomainControllersResponse
-> Rep DescribeDomainControllersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDomainControllersResponse x
-> DescribeDomainControllersResponse
$cfrom :: forall x.
DescribeDomainControllersResponse
-> Rep DescribeDomainControllersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDomainControllersResponse' 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:
--
-- 'nextToken', 'describeDomainControllersResponse_nextToken' - If not null, more results are available. Pass this value for the
-- @NextToken@ parameter in a subsequent call to DescribeDomainControllers
-- retrieve the next set of items.
--
-- 'domainControllers', 'describeDomainControllersResponse_domainControllers' - List of the DomainController objects that were retrieved.
--
-- 'httpStatus', 'describeDomainControllersResponse_httpStatus' - The response's http status code.
newDescribeDomainControllersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDomainControllersResponse
newDescribeDomainControllersResponse :: Int -> DescribeDomainControllersResponse
newDescribeDomainControllersResponse Int
pHttpStatus_ =
  DescribeDomainControllersResponse' :: Maybe Text
-> Maybe [DomainController]
-> Int
-> DescribeDomainControllersResponse
DescribeDomainControllersResponse'
    { $sel:nextToken:DescribeDomainControllersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainControllers:DescribeDomainControllersResponse' :: Maybe [DomainController]
domainControllers = Maybe [DomainController]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDomainControllersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If not null, more results are available. Pass this value for the
-- @NextToken@ parameter in a subsequent call to DescribeDomainControllers
-- retrieve the next set of items.
describeDomainControllersResponse_nextToken :: Lens.Lens' DescribeDomainControllersResponse (Prelude.Maybe Prelude.Text)
describeDomainControllersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDomainControllersResponse
-> f DescribeDomainControllersResponse
describeDomainControllersResponse_nextToken = (DescribeDomainControllersResponse -> Maybe Text)
-> (DescribeDomainControllersResponse
    -> Maybe Text -> DescribeDomainControllersResponse)
-> Lens' DescribeDomainControllersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainControllersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDomainControllersResponse' :: DescribeDomainControllersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDomainControllersResponse
s@DescribeDomainControllersResponse' {} Maybe Text
a -> DescribeDomainControllersResponse
s {$sel:nextToken:DescribeDomainControllersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDomainControllersResponse)

-- | List of the DomainController objects that were retrieved.
describeDomainControllersResponse_domainControllers :: Lens.Lens' DescribeDomainControllersResponse (Prelude.Maybe [DomainController])
describeDomainControllersResponse_domainControllers :: (Maybe [DomainController] -> f (Maybe [DomainController]))
-> DescribeDomainControllersResponse
-> f DescribeDomainControllersResponse
describeDomainControllersResponse_domainControllers = (DescribeDomainControllersResponse -> Maybe [DomainController])
-> (DescribeDomainControllersResponse
    -> Maybe [DomainController] -> DescribeDomainControllersResponse)
-> Lens'
     DescribeDomainControllersResponse (Maybe [DomainController])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDomainControllersResponse' {Maybe [DomainController]
domainControllers :: Maybe [DomainController]
$sel:domainControllers:DescribeDomainControllersResponse' :: DescribeDomainControllersResponse -> Maybe [DomainController]
domainControllers} -> Maybe [DomainController]
domainControllers) (\s :: DescribeDomainControllersResponse
s@DescribeDomainControllersResponse' {} Maybe [DomainController]
a -> DescribeDomainControllersResponse
s {$sel:domainControllers:DescribeDomainControllersResponse' :: Maybe [DomainController]
domainControllers = Maybe [DomainController]
a} :: DescribeDomainControllersResponse) ((Maybe [DomainController] -> f (Maybe [DomainController]))
 -> DescribeDomainControllersResponse
 -> f DescribeDomainControllersResponse)
-> ((Maybe [DomainController] -> f (Maybe [DomainController]))
    -> Maybe [DomainController] -> f (Maybe [DomainController]))
-> (Maybe [DomainController] -> f (Maybe [DomainController]))
-> DescribeDomainControllersResponse
-> f DescribeDomainControllersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DomainController]
  [DomainController]
  [DomainController]
  [DomainController]
-> Iso
     (Maybe [DomainController])
     (Maybe [DomainController])
     (Maybe [DomainController])
     (Maybe [DomainController])
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 AnIso
  [DomainController]
  [DomainController]
  [DomainController]
  [DomainController]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeDomainControllersResponse