{-# 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 #-}
module Amazonka.DirectoryService.DescribeConditionalForwarders
(
DescribeConditionalForwarders (..),
newDescribeConditionalForwarders,
describeConditionalForwarders_remoteDomainNames,
describeConditionalForwarders_directoryId,
DescribeConditionalForwardersResponse (..),
newDescribeConditionalForwardersResponse,
describeConditionalForwardersResponse_conditionalForwarders,
describeConditionalForwardersResponse_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
data DescribeConditionalForwarders = DescribeConditionalForwarders'
{
DescribeConditionalForwarders -> Maybe [Text]
remoteDomainNames :: Prelude.Maybe [Prelude.Text],
DescribeConditionalForwarders -> Text
directoryId :: Prelude.Text
}
deriving (DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool
(DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool)
-> (DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool)
-> Eq DescribeConditionalForwarders
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool
$c/= :: DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool
== :: DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool
$c== :: DescribeConditionalForwarders
-> DescribeConditionalForwarders -> Bool
Prelude.Eq, ReadPrec [DescribeConditionalForwarders]
ReadPrec DescribeConditionalForwarders
Int -> ReadS DescribeConditionalForwarders
ReadS [DescribeConditionalForwarders]
(Int -> ReadS DescribeConditionalForwarders)
-> ReadS [DescribeConditionalForwarders]
-> ReadPrec DescribeConditionalForwarders
-> ReadPrec [DescribeConditionalForwarders]
-> Read DescribeConditionalForwarders
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConditionalForwarders]
$creadListPrec :: ReadPrec [DescribeConditionalForwarders]
readPrec :: ReadPrec DescribeConditionalForwarders
$creadPrec :: ReadPrec DescribeConditionalForwarders
readList :: ReadS [DescribeConditionalForwarders]
$creadList :: ReadS [DescribeConditionalForwarders]
readsPrec :: Int -> ReadS DescribeConditionalForwarders
$creadsPrec :: Int -> ReadS DescribeConditionalForwarders
Prelude.Read, Int -> DescribeConditionalForwarders -> ShowS
[DescribeConditionalForwarders] -> ShowS
DescribeConditionalForwarders -> String
(Int -> DescribeConditionalForwarders -> ShowS)
-> (DescribeConditionalForwarders -> String)
-> ([DescribeConditionalForwarders] -> ShowS)
-> Show DescribeConditionalForwarders
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConditionalForwarders] -> ShowS
$cshowList :: [DescribeConditionalForwarders] -> ShowS
show :: DescribeConditionalForwarders -> String
$cshow :: DescribeConditionalForwarders -> String
showsPrec :: Int -> DescribeConditionalForwarders -> ShowS
$cshowsPrec :: Int -> DescribeConditionalForwarders -> ShowS
Prelude.Show, (forall x.
DescribeConditionalForwarders
-> Rep DescribeConditionalForwarders x)
-> (forall x.
Rep DescribeConditionalForwarders x
-> DescribeConditionalForwarders)
-> Generic DescribeConditionalForwarders
forall x.
Rep DescribeConditionalForwarders x
-> DescribeConditionalForwarders
forall x.
DescribeConditionalForwarders
-> Rep DescribeConditionalForwarders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConditionalForwarders x
-> DescribeConditionalForwarders
$cfrom :: forall x.
DescribeConditionalForwarders
-> Rep DescribeConditionalForwarders x
Prelude.Generic)
newDescribeConditionalForwarders ::
Prelude.Text ->
DescribeConditionalForwarders
newDescribeConditionalForwarders :: Text -> DescribeConditionalForwarders
newDescribeConditionalForwarders Text
pDirectoryId_ =
DescribeConditionalForwarders' :: Maybe [Text] -> Text -> DescribeConditionalForwarders
DescribeConditionalForwarders'
{ $sel:remoteDomainNames:DescribeConditionalForwarders' :: Maybe [Text]
remoteDomainNames =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:directoryId:DescribeConditionalForwarders' :: Text
directoryId = Text
pDirectoryId_
}
describeConditionalForwarders_remoteDomainNames :: Lens.Lens' DescribeConditionalForwarders (Prelude.Maybe [Prelude.Text])
describeConditionalForwarders_remoteDomainNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeConditionalForwarders -> f DescribeConditionalForwarders
describeConditionalForwarders_remoteDomainNames = (DescribeConditionalForwarders -> Maybe [Text])
-> (DescribeConditionalForwarders
-> Maybe [Text] -> DescribeConditionalForwarders)
-> Lens
DescribeConditionalForwarders
DescribeConditionalForwarders
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConditionalForwarders' {Maybe [Text]
remoteDomainNames :: Maybe [Text]
$sel:remoteDomainNames:DescribeConditionalForwarders' :: DescribeConditionalForwarders -> Maybe [Text]
remoteDomainNames} -> Maybe [Text]
remoteDomainNames) (\s :: DescribeConditionalForwarders
s@DescribeConditionalForwarders' {} Maybe [Text]
a -> DescribeConditionalForwarders
s {$sel:remoteDomainNames:DescribeConditionalForwarders' :: Maybe [Text]
remoteDomainNames = Maybe [Text]
a} :: DescribeConditionalForwarders) ((Maybe [Text] -> f (Maybe [Text]))
-> DescribeConditionalForwarders
-> f DescribeConditionalForwarders)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeConditionalForwarders
-> f DescribeConditionalForwarders
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
describeConditionalForwarders_directoryId :: Lens.Lens' DescribeConditionalForwarders Prelude.Text
describeConditionalForwarders_directoryId :: (Text -> f Text)
-> DescribeConditionalForwarders -> f DescribeConditionalForwarders
describeConditionalForwarders_directoryId = (DescribeConditionalForwarders -> Text)
-> (DescribeConditionalForwarders
-> Text -> DescribeConditionalForwarders)
-> Lens
DescribeConditionalForwarders
DescribeConditionalForwarders
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConditionalForwarders' {Text
directoryId :: Text
$sel:directoryId:DescribeConditionalForwarders' :: DescribeConditionalForwarders -> Text
directoryId} -> Text
directoryId) (\s :: DescribeConditionalForwarders
s@DescribeConditionalForwarders' {} Text
a -> DescribeConditionalForwarders
s {$sel:directoryId:DescribeConditionalForwarders' :: Text
directoryId = Text
a} :: DescribeConditionalForwarders)
instance
Core.AWSRequest
DescribeConditionalForwarders
where
type
AWSResponse DescribeConditionalForwarders =
DescribeConditionalForwardersResponse
request :: DescribeConditionalForwarders
-> Request DescribeConditionalForwarders
request = Service
-> DescribeConditionalForwarders
-> Request DescribeConditionalForwarders
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeConditionalForwarders
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeConditionalForwarders)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeConditionalForwarders))
-> Logger
-> Service
-> Proxy DescribeConditionalForwarders
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeConditionalForwarders)))
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 [ConditionalForwarder]
-> Int -> DescribeConditionalForwardersResponse
DescribeConditionalForwardersResponse'
(Maybe [ConditionalForwarder]
-> Int -> DescribeConditionalForwardersResponse)
-> Either String (Maybe [ConditionalForwarder])
-> Either String (Int -> DescribeConditionalForwardersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ConditionalForwarder]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConditionalForwarders"
Either String (Maybe (Maybe [ConditionalForwarder]))
-> Maybe [ConditionalForwarder]
-> Either String (Maybe [ConditionalForwarder])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ConditionalForwarder]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeConditionalForwardersResponse)
-> Either String Int
-> Either String DescribeConditionalForwardersResponse
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
DescribeConditionalForwarders
instance Prelude.NFData DescribeConditionalForwarders
instance Core.ToHeaders DescribeConditionalForwarders where
toHeaders :: DescribeConditionalForwarders -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeConditionalForwarders -> 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.DescribeConditionalForwarders" ::
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 DescribeConditionalForwarders where
toJSON :: DescribeConditionalForwarders -> Value
toJSON DescribeConditionalForwarders' {Maybe [Text]
Text
directoryId :: Text
remoteDomainNames :: Maybe [Text]
$sel:directoryId:DescribeConditionalForwarders' :: DescribeConditionalForwarders -> Text
$sel:remoteDomainNames:DescribeConditionalForwarders' :: DescribeConditionalForwarders -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RemoteDomainNames" 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]
remoteDomainNames,
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 DescribeConditionalForwarders where
toPath :: DescribeConditionalForwarders -> ByteString
toPath = ByteString -> DescribeConditionalForwarders -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeConditionalForwarders where
toQuery :: DescribeConditionalForwarders -> QueryString
toQuery = QueryString -> DescribeConditionalForwarders -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeConditionalForwardersResponse = DescribeConditionalForwardersResponse'
{
DescribeConditionalForwardersResponse
-> Maybe [ConditionalForwarder]
conditionalForwarders :: Prelude.Maybe [ConditionalForwarder],
DescribeConditionalForwardersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool
(DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool)
-> (DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool)
-> Eq DescribeConditionalForwardersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool
$c/= :: DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool
== :: DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool
$c== :: DescribeConditionalForwardersResponse
-> DescribeConditionalForwardersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeConditionalForwardersResponse]
ReadPrec DescribeConditionalForwardersResponse
Int -> ReadS DescribeConditionalForwardersResponse
ReadS [DescribeConditionalForwardersResponse]
(Int -> ReadS DescribeConditionalForwardersResponse)
-> ReadS [DescribeConditionalForwardersResponse]
-> ReadPrec DescribeConditionalForwardersResponse
-> ReadPrec [DescribeConditionalForwardersResponse]
-> Read DescribeConditionalForwardersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConditionalForwardersResponse]
$creadListPrec :: ReadPrec [DescribeConditionalForwardersResponse]
readPrec :: ReadPrec DescribeConditionalForwardersResponse
$creadPrec :: ReadPrec DescribeConditionalForwardersResponse
readList :: ReadS [DescribeConditionalForwardersResponse]
$creadList :: ReadS [DescribeConditionalForwardersResponse]
readsPrec :: Int -> ReadS DescribeConditionalForwardersResponse
$creadsPrec :: Int -> ReadS DescribeConditionalForwardersResponse
Prelude.Read, Int -> DescribeConditionalForwardersResponse -> ShowS
[DescribeConditionalForwardersResponse] -> ShowS
DescribeConditionalForwardersResponse -> String
(Int -> DescribeConditionalForwardersResponse -> ShowS)
-> (DescribeConditionalForwardersResponse -> String)
-> ([DescribeConditionalForwardersResponse] -> ShowS)
-> Show DescribeConditionalForwardersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConditionalForwardersResponse] -> ShowS
$cshowList :: [DescribeConditionalForwardersResponse] -> ShowS
show :: DescribeConditionalForwardersResponse -> String
$cshow :: DescribeConditionalForwardersResponse -> String
showsPrec :: Int -> DescribeConditionalForwardersResponse -> ShowS
$cshowsPrec :: Int -> DescribeConditionalForwardersResponse -> ShowS
Prelude.Show, (forall x.
DescribeConditionalForwardersResponse
-> Rep DescribeConditionalForwardersResponse x)
-> (forall x.
Rep DescribeConditionalForwardersResponse x
-> DescribeConditionalForwardersResponse)
-> Generic DescribeConditionalForwardersResponse
forall x.
Rep DescribeConditionalForwardersResponse x
-> DescribeConditionalForwardersResponse
forall x.
DescribeConditionalForwardersResponse
-> Rep DescribeConditionalForwardersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConditionalForwardersResponse x
-> DescribeConditionalForwardersResponse
$cfrom :: forall x.
DescribeConditionalForwardersResponse
-> Rep DescribeConditionalForwardersResponse x
Prelude.Generic)
newDescribeConditionalForwardersResponse ::
Prelude.Int ->
DescribeConditionalForwardersResponse
newDescribeConditionalForwardersResponse :: Int -> DescribeConditionalForwardersResponse
newDescribeConditionalForwardersResponse Int
pHttpStatus_ =
DescribeConditionalForwardersResponse' :: Maybe [ConditionalForwarder]
-> Int -> DescribeConditionalForwardersResponse
DescribeConditionalForwardersResponse'
{ $sel:conditionalForwarders:DescribeConditionalForwardersResponse' :: Maybe [ConditionalForwarder]
conditionalForwarders =
Maybe [ConditionalForwarder]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeConditionalForwardersResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeConditionalForwardersResponse_conditionalForwarders :: Lens.Lens' DescribeConditionalForwardersResponse (Prelude.Maybe [ConditionalForwarder])
describeConditionalForwardersResponse_conditionalForwarders :: (Maybe [ConditionalForwarder] -> f (Maybe [ConditionalForwarder]))
-> DescribeConditionalForwardersResponse
-> f DescribeConditionalForwardersResponse
describeConditionalForwardersResponse_conditionalForwarders = (DescribeConditionalForwardersResponse
-> Maybe [ConditionalForwarder])
-> (DescribeConditionalForwardersResponse
-> Maybe [ConditionalForwarder]
-> DescribeConditionalForwardersResponse)
-> Lens
DescribeConditionalForwardersResponse
DescribeConditionalForwardersResponse
(Maybe [ConditionalForwarder])
(Maybe [ConditionalForwarder])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConditionalForwardersResponse' {Maybe [ConditionalForwarder]
conditionalForwarders :: Maybe [ConditionalForwarder]
$sel:conditionalForwarders:DescribeConditionalForwardersResponse' :: DescribeConditionalForwardersResponse
-> Maybe [ConditionalForwarder]
conditionalForwarders} -> Maybe [ConditionalForwarder]
conditionalForwarders) (\s :: DescribeConditionalForwardersResponse
s@DescribeConditionalForwardersResponse' {} Maybe [ConditionalForwarder]
a -> DescribeConditionalForwardersResponse
s {$sel:conditionalForwarders:DescribeConditionalForwardersResponse' :: Maybe [ConditionalForwarder]
conditionalForwarders = Maybe [ConditionalForwarder]
a} :: DescribeConditionalForwardersResponse) ((Maybe [ConditionalForwarder] -> f (Maybe [ConditionalForwarder]))
-> DescribeConditionalForwardersResponse
-> f DescribeConditionalForwardersResponse)
-> ((Maybe [ConditionalForwarder]
-> f (Maybe [ConditionalForwarder]))
-> Maybe [ConditionalForwarder]
-> f (Maybe [ConditionalForwarder]))
-> (Maybe [ConditionalForwarder]
-> f (Maybe [ConditionalForwarder]))
-> DescribeConditionalForwardersResponse
-> f DescribeConditionalForwardersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ConditionalForwarder]
[ConditionalForwarder]
[ConditionalForwarder]
[ConditionalForwarder]
-> Iso
(Maybe [ConditionalForwarder])
(Maybe [ConditionalForwarder])
(Maybe [ConditionalForwarder])
(Maybe [ConditionalForwarder])
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
[ConditionalForwarder]
[ConditionalForwarder]
[ConditionalForwarder]
[ConditionalForwarder]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeConditionalForwardersResponse_httpStatus :: Lens.Lens' DescribeConditionalForwardersResponse Prelude.Int
describeConditionalForwardersResponse_httpStatus :: (Int -> f Int)
-> DescribeConditionalForwardersResponse
-> f DescribeConditionalForwardersResponse
describeConditionalForwardersResponse_httpStatus = (DescribeConditionalForwardersResponse -> Int)
-> (DescribeConditionalForwardersResponse
-> Int -> DescribeConditionalForwardersResponse)
-> Lens
DescribeConditionalForwardersResponse
DescribeConditionalForwardersResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConditionalForwardersResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeConditionalForwardersResponse' :: DescribeConditionalForwardersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeConditionalForwardersResponse
s@DescribeConditionalForwardersResponse' {} Int
a -> DescribeConditionalForwardersResponse
s {$sel:httpStatus:DescribeConditionalForwardersResponse' :: Int
httpStatus = Int
a} :: DescribeConditionalForwardersResponse)
instance
Prelude.NFData
DescribeConditionalForwardersResponse