{-# 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.Route53.Types.HostedZoneConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
data HostedZoneConfig = HostedZoneConfig'
{
HostedZoneConfig -> Maybe Bool
privateZone :: Prelude.Maybe Prelude.Bool,
:: Prelude.Maybe Prelude.Text
}
deriving (HostedZoneConfig -> HostedZoneConfig -> Bool
(HostedZoneConfig -> HostedZoneConfig -> Bool)
-> (HostedZoneConfig -> HostedZoneConfig -> Bool)
-> Eq HostedZoneConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HostedZoneConfig -> HostedZoneConfig -> Bool
$c/= :: HostedZoneConfig -> HostedZoneConfig -> Bool
== :: HostedZoneConfig -> HostedZoneConfig -> Bool
$c== :: HostedZoneConfig -> HostedZoneConfig -> Bool
Prelude.Eq, ReadPrec [HostedZoneConfig]
ReadPrec HostedZoneConfig
Int -> ReadS HostedZoneConfig
ReadS [HostedZoneConfig]
(Int -> ReadS HostedZoneConfig)
-> ReadS [HostedZoneConfig]
-> ReadPrec HostedZoneConfig
-> ReadPrec [HostedZoneConfig]
-> Read HostedZoneConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HostedZoneConfig]
$creadListPrec :: ReadPrec [HostedZoneConfig]
readPrec :: ReadPrec HostedZoneConfig
$creadPrec :: ReadPrec HostedZoneConfig
readList :: ReadS [HostedZoneConfig]
$creadList :: ReadS [HostedZoneConfig]
readsPrec :: Int -> ReadS HostedZoneConfig
$creadsPrec :: Int -> ReadS HostedZoneConfig
Prelude.Read, Int -> HostedZoneConfig -> ShowS
[HostedZoneConfig] -> ShowS
HostedZoneConfig -> String
(Int -> HostedZoneConfig -> ShowS)
-> (HostedZoneConfig -> String)
-> ([HostedZoneConfig] -> ShowS)
-> Show HostedZoneConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HostedZoneConfig] -> ShowS
$cshowList :: [HostedZoneConfig] -> ShowS
show :: HostedZoneConfig -> String
$cshow :: HostedZoneConfig -> String
showsPrec :: Int -> HostedZoneConfig -> ShowS
$cshowsPrec :: Int -> HostedZoneConfig -> ShowS
Prelude.Show, (forall x. HostedZoneConfig -> Rep HostedZoneConfig x)
-> (forall x. Rep HostedZoneConfig x -> HostedZoneConfig)
-> Generic HostedZoneConfig
forall x. Rep HostedZoneConfig x -> HostedZoneConfig
forall x. HostedZoneConfig -> Rep HostedZoneConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HostedZoneConfig x -> HostedZoneConfig
$cfrom :: forall x. HostedZoneConfig -> Rep HostedZoneConfig x
Prelude.Generic)
newHostedZoneConfig ::
HostedZoneConfig
newHostedZoneConfig :: HostedZoneConfig
newHostedZoneConfig =
HostedZoneConfig' :: Maybe Bool -> Maybe Text -> HostedZoneConfig
HostedZoneConfig'
{ $sel:privateZone:HostedZoneConfig' :: Maybe Bool
privateZone = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:comment:HostedZoneConfig' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
hostedZoneConfig_privateZone :: Lens.Lens' HostedZoneConfig (Prelude.Maybe Prelude.Bool)
hostedZoneConfig_privateZone :: (Maybe Bool -> f (Maybe Bool))
-> HostedZoneConfig -> f HostedZoneConfig
hostedZoneConfig_privateZone = (HostedZoneConfig -> Maybe Bool)
-> (HostedZoneConfig -> Maybe Bool -> HostedZoneConfig)
-> Lens HostedZoneConfig HostedZoneConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZoneConfig' {Maybe Bool
privateZone :: Maybe Bool
$sel:privateZone:HostedZoneConfig' :: HostedZoneConfig -> Maybe Bool
privateZone} -> Maybe Bool
privateZone) (\s :: HostedZoneConfig
s@HostedZoneConfig' {} Maybe Bool
a -> HostedZoneConfig
s {$sel:privateZone:HostedZoneConfig' :: Maybe Bool
privateZone = Maybe Bool
a} :: HostedZoneConfig)
hostedZoneConfig_comment :: Lens.Lens' HostedZoneConfig (Prelude.Maybe Prelude.Text)
= (HostedZoneConfig -> Maybe Text)
-> (HostedZoneConfig -> Maybe Text -> HostedZoneConfig)
-> Lens HostedZoneConfig HostedZoneConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZoneConfig' {Maybe Text
comment :: Maybe Text
$sel:comment:HostedZoneConfig' :: HostedZoneConfig -> Maybe Text
comment} -> Maybe Text
comment) (\s :: HostedZoneConfig
s@HostedZoneConfig' {} Maybe Text
a -> HostedZoneConfig
s {$sel:comment:HostedZoneConfig' :: Maybe Text
comment = Maybe Text
a} :: HostedZoneConfig)
instance Core.FromXML HostedZoneConfig where
parseXML :: [Node] -> Either String HostedZoneConfig
parseXML [Node]
x =
Maybe Bool -> Maybe Text -> HostedZoneConfig
HostedZoneConfig'
(Maybe Bool -> Maybe Text -> HostedZoneConfig)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> HostedZoneConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PrivateZone")
Either String (Maybe Text -> HostedZoneConfig)
-> Either String (Maybe Text) -> Either String HostedZoneConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Comment")
instance Prelude.Hashable HostedZoneConfig
instance Prelude.NFData HostedZoneConfig
instance Core.ToXML HostedZoneConfig where
toXML :: HostedZoneConfig -> XML
toXML HostedZoneConfig' {Maybe Bool
Maybe Text
comment :: Maybe Text
privateZone :: Maybe Bool
$sel:comment:HostedZoneConfig' :: HostedZoneConfig -> Maybe Text
$sel:privateZone:HostedZoneConfig' :: HostedZoneConfig -> Maybe Bool
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"PrivateZone" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
privateZone,
Name
"Comment" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
comment
]