{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectoryService.Types.ReplicationScope
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
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]
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
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. 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'
{ $sel:dnsIpAddrs:ConditionalForwarder' :: Maybe [Text]
dnsIpAddrs = forall a. Maybe a
Prelude.Nothing,
$sel:remoteDomainName:ConditionalForwarder' :: Maybe Text
remoteDomainName = forall a. Maybe a
Prelude.Nothing,
$sel:replicationScope:ConditionalForwarder' :: Maybe ReplicationScope
replicationScope = forall a. Maybe a
Prelude.Nothing
}
conditionalForwarder_dnsIpAddrs :: Lens.Lens' ConditionalForwarder (Prelude.Maybe [Prelude.Text])
conditionalForwarder_dnsIpAddrs :: Lens' ConditionalForwarder (Maybe [Text])
conditionalForwarder_dnsIpAddrs = 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) 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
conditionalForwarder_remoteDomainName :: Lens.Lens' ConditionalForwarder (Prelude.Maybe Prelude.Text)
conditionalForwarder_remoteDomainName :: Lens' ConditionalForwarder (Maybe Text)
conditionalForwarder_remoteDomainName = 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 :: Lens' ConditionalForwarder (Maybe ReplicationScope)
conditionalForwarder_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 Data.FromJSON ConditionalForwarder where
parseJSON :: Value -> Parser ConditionalForwarder
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ConditionalForwarder"
( \Object
x ->
Maybe [Text]
-> Maybe Text -> Maybe ReplicationScope -> ConditionalForwarder
ConditionalForwarder'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DnsIpAddrs" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"RemoteDomainName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ReplicationScope")
)
instance Prelude.Hashable ConditionalForwarder where
hashWithSalt :: Int -> ConditionalForwarder -> Int
hashWithSalt Int
_salt ConditionalForwarder' {Maybe [Text]
Maybe Text
Maybe ReplicationScope
replicationScope :: Maybe ReplicationScope
remoteDomainName :: Maybe Text
dnsIpAddrs :: Maybe [Text]
$sel:replicationScope:ConditionalForwarder' :: ConditionalForwarder -> Maybe ReplicationScope
$sel:remoteDomainName:ConditionalForwarder' :: ConditionalForwarder -> Maybe Text
$sel:dnsIpAddrs:ConditionalForwarder' :: ConditionalForwarder -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
dnsIpAddrs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
remoteDomainName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReplicationScope
replicationScope
instance Prelude.NFData ConditionalForwarder where
rnf :: ConditionalForwarder -> ()
rnf ConditionalForwarder' {Maybe [Text]
Maybe Text
Maybe ReplicationScope
replicationScope :: Maybe ReplicationScope
remoteDomainName :: Maybe Text
dnsIpAddrs :: Maybe [Text]
$sel:replicationScope:ConditionalForwarder' :: ConditionalForwarder -> Maybe ReplicationScope
$sel:remoteDomainName:ConditionalForwarder' :: ConditionalForwarder -> Maybe Text
$sel:dnsIpAddrs:ConditionalForwarder' :: ConditionalForwarder -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
dnsIpAddrs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
remoteDomainName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplicationScope
replicationScope