{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DirectoryService.Types.ConditionalForwarder where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types.ReplicationScope
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConditionalForwarder = ConditionalForwarder'
{
ConditionalForwarder -> Maybe [Text]
dnsIpAddrs :: Prelude.Maybe [Prelude.Text],
ConditionalForwarder -> Maybe Text
remoteDomainName :: Prelude.Maybe Prelude.Text,
ConditionalForwarder -> Maybe ReplicationScope
replicationScope :: Prelude.Maybe ReplicationScope
}
deriving (ConditionalForwarder -> ConditionalForwarder -> Bool
(ConditionalForwarder -> ConditionalForwarder -> Bool)
-> (ConditionalForwarder -> ConditionalForwarder -> Bool)
-> Eq ConditionalForwarder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConditionalForwarder -> ConditionalForwarder -> Bool
$c/= :: ConditionalForwarder -> ConditionalForwarder -> Bool
== :: ConditionalForwarder -> ConditionalForwarder -> Bool
$c== :: ConditionalForwarder -> ConditionalForwarder -> Bool
Prelude.Eq, ReadPrec [ConditionalForwarder]
ReadPrec ConditionalForwarder
Int -> ReadS ConditionalForwarder
ReadS [ConditionalForwarder]
(Int -> ReadS ConditionalForwarder)
-> ReadS [ConditionalForwarder]
-> ReadPrec ConditionalForwarder
-> ReadPrec [ConditionalForwarder]
-> Read ConditionalForwarder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConditionalForwarder]
$creadListPrec :: ReadPrec [ConditionalForwarder]
readPrec :: ReadPrec ConditionalForwarder
$creadPrec :: ReadPrec ConditionalForwarder
readList :: ReadS [ConditionalForwarder]
$creadList :: ReadS [ConditionalForwarder]
readsPrec :: Int -> ReadS ConditionalForwarder
$creadsPrec :: Int -> ReadS ConditionalForwarder
Prelude.Read, Int -> ConditionalForwarder -> ShowS
[ConditionalForwarder] -> ShowS
ConditionalForwarder -> String
(Int -> ConditionalForwarder -> ShowS)
-> (ConditionalForwarder -> String)
-> ([ConditionalForwarder] -> ShowS)
-> Show ConditionalForwarder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConditionalForwarder] -> ShowS
$cshowList :: [ConditionalForwarder] -> ShowS
show :: ConditionalForwarder -> String
$cshow :: ConditionalForwarder -> String
showsPrec :: Int -> ConditionalForwarder -> ShowS
$cshowsPrec :: Int -> ConditionalForwarder -> ShowS
Prelude.Show, (forall x. ConditionalForwarder -> Rep ConditionalForwarder x)
-> (forall x. Rep ConditionalForwarder x -> ConditionalForwarder)
-> Generic ConditionalForwarder
forall x. Rep ConditionalForwarder x -> ConditionalForwarder
forall x. ConditionalForwarder -> Rep ConditionalForwarder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConditionalForwarder x -> ConditionalForwarder
$cfrom :: forall x. ConditionalForwarder -> Rep ConditionalForwarder x
Prelude.Generic)
newConditionalForwarder ::
ConditionalForwarder
newConditionalForwarder :: ConditionalForwarder
newConditionalForwarder =
ConditionalForwarder' :: Maybe [Text]
-> Maybe Text -> Maybe ReplicationScope -> ConditionalForwarder
ConditionalForwarder'
{ $sel:dnsIpAddrs:ConditionalForwarder' :: Maybe [Text]
dnsIpAddrs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:remoteDomainName:ConditionalForwarder' :: Maybe Text
remoteDomainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replicationScope:ConditionalForwarder' :: Maybe ReplicationScope
replicationScope = Maybe ReplicationScope
forall a. Maybe a
Prelude.Nothing
}
conditionalForwarder_dnsIpAddrs :: Lens.Lens' ConditionalForwarder (Prelude.Maybe [Prelude.Text])
conditionalForwarder_dnsIpAddrs :: (Maybe [Text] -> f (Maybe [Text]))
-> ConditionalForwarder -> f ConditionalForwarder
conditionalForwarder_dnsIpAddrs = (ConditionalForwarder -> Maybe [Text])
-> (ConditionalForwarder -> Maybe [Text] -> ConditionalForwarder)
-> Lens
ConditionalForwarder
ConditionalForwarder
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionalForwarder' {Maybe [Text]
dnsIpAddrs :: Maybe [Text]
$sel:dnsIpAddrs:ConditionalForwarder' :: ConditionalForwarder -> Maybe [Text]
dnsIpAddrs} -> Maybe [Text]
dnsIpAddrs) (\s :: ConditionalForwarder
s@ConditionalForwarder' {} Maybe [Text]
a -> ConditionalForwarder
s {$sel:dnsIpAddrs:ConditionalForwarder' :: Maybe [Text]
dnsIpAddrs = Maybe [Text]
a} :: ConditionalForwarder) ((Maybe [Text] -> f (Maybe [Text]))
-> ConditionalForwarder -> f ConditionalForwarder)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ConditionalForwarder
-> f ConditionalForwarder
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
conditionalForwarder_remoteDomainName :: Lens.Lens' ConditionalForwarder (Prelude.Maybe Prelude.Text)
conditionalForwarder_remoteDomainName :: (Maybe Text -> f (Maybe Text))
-> ConditionalForwarder -> f ConditionalForwarder
conditionalForwarder_remoteDomainName = (ConditionalForwarder -> Maybe Text)
-> (ConditionalForwarder -> Maybe Text -> ConditionalForwarder)
-> Lens
ConditionalForwarder ConditionalForwarder (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionalForwarder' {Maybe Text
remoteDomainName :: Maybe Text
$sel:remoteDomainName:ConditionalForwarder' :: ConditionalForwarder -> Maybe Text
remoteDomainName} -> Maybe Text
remoteDomainName) (\s :: ConditionalForwarder
s@ConditionalForwarder' {} Maybe Text
a -> ConditionalForwarder
s {$sel:remoteDomainName:ConditionalForwarder' :: Maybe Text
remoteDomainName = Maybe Text
a} :: ConditionalForwarder)
conditionalForwarder_replicationScope :: Lens.Lens' ConditionalForwarder (Prelude.Maybe ReplicationScope)
conditionalForwarder_replicationScope :: (Maybe ReplicationScope -> f (Maybe ReplicationScope))
-> ConditionalForwarder -> f ConditionalForwarder
conditionalForwarder_replicationScope = (ConditionalForwarder -> Maybe ReplicationScope)
-> (ConditionalForwarder
-> Maybe ReplicationScope -> ConditionalForwarder)
-> Lens
ConditionalForwarder
ConditionalForwarder
(Maybe ReplicationScope)
(Maybe ReplicationScope)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConditionalForwarder' {Maybe ReplicationScope
replicationScope :: Maybe ReplicationScope
$sel:replicationScope:ConditionalForwarder' :: ConditionalForwarder -> Maybe ReplicationScope
replicationScope} -> Maybe ReplicationScope
replicationScope) (\s :: ConditionalForwarder
s@ConditionalForwarder' {} Maybe ReplicationScope
a -> ConditionalForwarder
s {$sel:replicationScope:ConditionalForwarder' :: Maybe ReplicationScope
replicationScope = Maybe ReplicationScope
a} :: ConditionalForwarder)
instance Core.FromJSON ConditionalForwarder where
parseJSON :: Value -> Parser ConditionalForwarder
parseJSON =
String
-> (Object -> Parser ConditionalForwarder)
-> Value
-> Parser ConditionalForwarder
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConditionalForwarder"
( \Object
x ->
Maybe [Text]
-> Maybe Text -> Maybe ReplicationScope -> ConditionalForwarder
ConditionalForwarder'
(Maybe [Text]
-> Maybe Text -> Maybe ReplicationScope -> ConditionalForwarder)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text -> Maybe ReplicationScope -> ConditionalForwarder)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DnsIpAddrs" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text -> Maybe ReplicationScope -> ConditionalForwarder)
-> Parser (Maybe Text)
-> Parser (Maybe ReplicationScope -> ConditionalForwarder)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RemoteDomainName")
Parser (Maybe ReplicationScope -> ConditionalForwarder)
-> Parser (Maybe ReplicationScope) -> Parser ConditionalForwarder
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReplicationScope)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicationScope")
)
instance Prelude.Hashable ConditionalForwarder
instance Prelude.NFData ConditionalForwarder