{-# 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.HostedZone where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
import Amazonka.Route53.Types.HostedZoneConfig
import Amazonka.Route53.Types.LinkedService
data HostedZone = HostedZone'
{
HostedZone -> Maybe LinkedService
linkedService :: Prelude.Maybe LinkedService,
HostedZone -> Maybe HostedZoneConfig
config :: Prelude.Maybe HostedZoneConfig,
HostedZone -> Maybe Integer
resourceRecordSetCount :: Prelude.Maybe Prelude.Integer,
HostedZone -> ResourceId
id :: ResourceId,
HostedZone -> Text
name :: Prelude.Text,
HostedZone -> Text
callerReference :: Prelude.Text
}
deriving (HostedZone -> HostedZone -> Bool
(HostedZone -> HostedZone -> Bool)
-> (HostedZone -> HostedZone -> Bool) -> Eq HostedZone
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HostedZone -> HostedZone -> Bool
$c/= :: HostedZone -> HostedZone -> Bool
== :: HostedZone -> HostedZone -> Bool
$c== :: HostedZone -> HostedZone -> Bool
Prelude.Eq, ReadPrec [HostedZone]
ReadPrec HostedZone
Int -> ReadS HostedZone
ReadS [HostedZone]
(Int -> ReadS HostedZone)
-> ReadS [HostedZone]
-> ReadPrec HostedZone
-> ReadPrec [HostedZone]
-> Read HostedZone
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HostedZone]
$creadListPrec :: ReadPrec [HostedZone]
readPrec :: ReadPrec HostedZone
$creadPrec :: ReadPrec HostedZone
readList :: ReadS [HostedZone]
$creadList :: ReadS [HostedZone]
readsPrec :: Int -> ReadS HostedZone
$creadsPrec :: Int -> ReadS HostedZone
Prelude.Read, Int -> HostedZone -> ShowS
[HostedZone] -> ShowS
HostedZone -> String
(Int -> HostedZone -> ShowS)
-> (HostedZone -> String)
-> ([HostedZone] -> ShowS)
-> Show HostedZone
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HostedZone] -> ShowS
$cshowList :: [HostedZone] -> ShowS
show :: HostedZone -> String
$cshow :: HostedZone -> String
showsPrec :: Int -> HostedZone -> ShowS
$cshowsPrec :: Int -> HostedZone -> ShowS
Prelude.Show, (forall x. HostedZone -> Rep HostedZone x)
-> (forall x. Rep HostedZone x -> HostedZone) -> Generic HostedZone
forall x. Rep HostedZone x -> HostedZone
forall x. HostedZone -> Rep HostedZone x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HostedZone x -> HostedZone
$cfrom :: forall x. HostedZone -> Rep HostedZone x
Prelude.Generic)
newHostedZone ::
ResourceId ->
Prelude.Text ->
Prelude.Text ->
HostedZone
newHostedZone :: ResourceId -> Text -> Text -> HostedZone
newHostedZone ResourceId
pId_ Text
pName_ Text
pCallerReference_ =
HostedZone' :: Maybe LinkedService
-> Maybe HostedZoneConfig
-> Maybe Integer
-> ResourceId
-> Text
-> Text
-> HostedZone
HostedZone'
{ $sel:linkedService:HostedZone' :: Maybe LinkedService
linkedService = Maybe LinkedService
forall a. Maybe a
Prelude.Nothing,
$sel:config:HostedZone' :: Maybe HostedZoneConfig
config = Maybe HostedZoneConfig
forall a. Maybe a
Prelude.Nothing,
$sel:resourceRecordSetCount:HostedZone' :: Maybe Integer
resourceRecordSetCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:id:HostedZone' :: ResourceId
id = ResourceId
pId_,
$sel:name:HostedZone' :: Text
name = Text
pName_,
$sel:callerReference:HostedZone' :: Text
callerReference = Text
pCallerReference_
}
hostedZone_linkedService :: Lens.Lens' HostedZone (Prelude.Maybe LinkedService)
hostedZone_linkedService :: (Maybe LinkedService -> f (Maybe LinkedService))
-> HostedZone -> f HostedZone
hostedZone_linkedService = (HostedZone -> Maybe LinkedService)
-> (HostedZone -> Maybe LinkedService -> HostedZone)
-> Lens
HostedZone HostedZone (Maybe LinkedService) (Maybe LinkedService)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZone' {Maybe LinkedService
linkedService :: Maybe LinkedService
$sel:linkedService:HostedZone' :: HostedZone -> Maybe LinkedService
linkedService} -> Maybe LinkedService
linkedService) (\s :: HostedZone
s@HostedZone' {} Maybe LinkedService
a -> HostedZone
s {$sel:linkedService:HostedZone' :: Maybe LinkedService
linkedService = Maybe LinkedService
a} :: HostedZone)
hostedZone_config :: Lens.Lens' HostedZone (Prelude.Maybe HostedZoneConfig)
hostedZone_config :: (Maybe HostedZoneConfig -> f (Maybe HostedZoneConfig))
-> HostedZone -> f HostedZone
hostedZone_config = (HostedZone -> Maybe HostedZoneConfig)
-> (HostedZone -> Maybe HostedZoneConfig -> HostedZone)
-> Lens
HostedZone
HostedZone
(Maybe HostedZoneConfig)
(Maybe HostedZoneConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZone' {Maybe HostedZoneConfig
config :: Maybe HostedZoneConfig
$sel:config:HostedZone' :: HostedZone -> Maybe HostedZoneConfig
config} -> Maybe HostedZoneConfig
config) (\s :: HostedZone
s@HostedZone' {} Maybe HostedZoneConfig
a -> HostedZone
s {$sel:config:HostedZone' :: Maybe HostedZoneConfig
config = Maybe HostedZoneConfig
a} :: HostedZone)
hostedZone_resourceRecordSetCount :: Lens.Lens' HostedZone (Prelude.Maybe Prelude.Integer)
hostedZone_resourceRecordSetCount :: (Maybe Integer -> f (Maybe Integer)) -> HostedZone -> f HostedZone
hostedZone_resourceRecordSetCount = (HostedZone -> Maybe Integer)
-> (HostedZone -> Maybe Integer -> HostedZone)
-> Lens HostedZone HostedZone (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZone' {Maybe Integer
resourceRecordSetCount :: Maybe Integer
$sel:resourceRecordSetCount:HostedZone' :: HostedZone -> Maybe Integer
resourceRecordSetCount} -> Maybe Integer
resourceRecordSetCount) (\s :: HostedZone
s@HostedZone' {} Maybe Integer
a -> HostedZone
s {$sel:resourceRecordSetCount:HostedZone' :: Maybe Integer
resourceRecordSetCount = Maybe Integer
a} :: HostedZone)
hostedZone_id :: Lens.Lens' HostedZone ResourceId
hostedZone_id :: (ResourceId -> f ResourceId) -> HostedZone -> f HostedZone
hostedZone_id = (HostedZone -> ResourceId)
-> (HostedZone -> ResourceId -> HostedZone)
-> Lens HostedZone HostedZone ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZone' {ResourceId
id :: ResourceId
$sel:id:HostedZone' :: HostedZone -> ResourceId
id} -> ResourceId
id) (\s :: HostedZone
s@HostedZone' {} ResourceId
a -> HostedZone
s {$sel:id:HostedZone' :: ResourceId
id = ResourceId
a} :: HostedZone)
hostedZone_name :: Lens.Lens' HostedZone Prelude.Text
hostedZone_name :: (Text -> f Text) -> HostedZone -> f HostedZone
hostedZone_name = (HostedZone -> Text)
-> (HostedZone -> Text -> HostedZone)
-> Lens HostedZone HostedZone Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZone' {Text
name :: Text
$sel:name:HostedZone' :: HostedZone -> Text
name} -> Text
name) (\s :: HostedZone
s@HostedZone' {} Text
a -> HostedZone
s {$sel:name:HostedZone' :: Text
name = Text
a} :: HostedZone)
hostedZone_callerReference :: Lens.Lens' HostedZone Prelude.Text
hostedZone_callerReference :: (Text -> f Text) -> HostedZone -> f HostedZone
hostedZone_callerReference = (HostedZone -> Text)
-> (HostedZone -> Text -> HostedZone)
-> Lens HostedZone HostedZone Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HostedZone' {Text
callerReference :: Text
$sel:callerReference:HostedZone' :: HostedZone -> Text
callerReference} -> Text
callerReference) (\s :: HostedZone
s@HostedZone' {} Text
a -> HostedZone
s {$sel:callerReference:HostedZone' :: Text
callerReference = Text
a} :: HostedZone)
instance Core.FromXML HostedZone where
parseXML :: [Node] -> Either String HostedZone
parseXML [Node]
x =
Maybe LinkedService
-> Maybe HostedZoneConfig
-> Maybe Integer
-> ResourceId
-> Text
-> Text
-> HostedZone
HostedZone'
(Maybe LinkedService
-> Maybe HostedZoneConfig
-> Maybe Integer
-> ResourceId
-> Text
-> Text
-> HostedZone)
-> Either String (Maybe LinkedService)
-> Either
String
(Maybe HostedZoneConfig
-> Maybe Integer -> ResourceId -> Text -> Text -> HostedZone)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe LinkedService)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LinkedService")
Either
String
(Maybe HostedZoneConfig
-> Maybe Integer -> ResourceId -> Text -> Text -> HostedZone)
-> Either String (Maybe HostedZoneConfig)
-> Either
String (Maybe Integer -> ResourceId -> Text -> Text -> HostedZone)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe HostedZoneConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Config")
Either
String (Maybe Integer -> ResourceId -> Text -> Text -> HostedZone)
-> Either String (Maybe Integer)
-> Either String (ResourceId -> Text -> Text -> HostedZone)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Integer)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResourceRecordSetCount")
Either String (ResourceId -> Text -> Text -> HostedZone)
-> Either String ResourceId
-> Either String (Text -> Text -> HostedZone)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ResourceId
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Id")
Either String (Text -> Text -> HostedZone)
-> Either String Text -> Either String (Text -> HostedZone)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Name")
Either String (Text -> HostedZone)
-> Either String Text -> Either String HostedZone
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CallerReference")
instance Prelude.Hashable HostedZone
instance Prelude.NFData HostedZone