{-# 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.TrafficPolicyInstance 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.RRType
data TrafficPolicyInstance = TrafficPolicyInstance'
{
TrafficPolicyInstance -> Text
id :: Prelude.Text,
TrafficPolicyInstance -> ResourceId
hostedZoneId :: ResourceId,
TrafficPolicyInstance -> Text
name :: Prelude.Text,
TrafficPolicyInstance -> Natural
ttl :: Prelude.Natural,
TrafficPolicyInstance -> Text
state :: Prelude.Text,
TrafficPolicyInstance -> Text
message :: Prelude.Text,
TrafficPolicyInstance -> Text
trafficPolicyId :: Prelude.Text,
TrafficPolicyInstance -> Natural
trafficPolicyVersion :: Prelude.Natural,
TrafficPolicyInstance -> RRType
trafficPolicyType :: RRType
}
deriving (TrafficPolicyInstance -> TrafficPolicyInstance -> Bool
(TrafficPolicyInstance -> TrafficPolicyInstance -> Bool)
-> (TrafficPolicyInstance -> TrafficPolicyInstance -> Bool)
-> Eq TrafficPolicyInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrafficPolicyInstance -> TrafficPolicyInstance -> Bool
$c/= :: TrafficPolicyInstance -> TrafficPolicyInstance -> Bool
== :: TrafficPolicyInstance -> TrafficPolicyInstance -> Bool
$c== :: TrafficPolicyInstance -> TrafficPolicyInstance -> Bool
Prelude.Eq, ReadPrec [TrafficPolicyInstance]
ReadPrec TrafficPolicyInstance
Int -> ReadS TrafficPolicyInstance
ReadS [TrafficPolicyInstance]
(Int -> ReadS TrafficPolicyInstance)
-> ReadS [TrafficPolicyInstance]
-> ReadPrec TrafficPolicyInstance
-> ReadPrec [TrafficPolicyInstance]
-> Read TrafficPolicyInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrafficPolicyInstance]
$creadListPrec :: ReadPrec [TrafficPolicyInstance]
readPrec :: ReadPrec TrafficPolicyInstance
$creadPrec :: ReadPrec TrafficPolicyInstance
readList :: ReadS [TrafficPolicyInstance]
$creadList :: ReadS [TrafficPolicyInstance]
readsPrec :: Int -> ReadS TrafficPolicyInstance
$creadsPrec :: Int -> ReadS TrafficPolicyInstance
Prelude.Read, Int -> TrafficPolicyInstance -> ShowS
[TrafficPolicyInstance] -> ShowS
TrafficPolicyInstance -> String
(Int -> TrafficPolicyInstance -> ShowS)
-> (TrafficPolicyInstance -> String)
-> ([TrafficPolicyInstance] -> ShowS)
-> Show TrafficPolicyInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrafficPolicyInstance] -> ShowS
$cshowList :: [TrafficPolicyInstance] -> ShowS
show :: TrafficPolicyInstance -> String
$cshow :: TrafficPolicyInstance -> String
showsPrec :: Int -> TrafficPolicyInstance -> ShowS
$cshowsPrec :: Int -> TrafficPolicyInstance -> ShowS
Prelude.Show, (forall x. TrafficPolicyInstance -> Rep TrafficPolicyInstance x)
-> (forall x. Rep TrafficPolicyInstance x -> TrafficPolicyInstance)
-> Generic TrafficPolicyInstance
forall x. Rep TrafficPolicyInstance x -> TrafficPolicyInstance
forall x. TrafficPolicyInstance -> Rep TrafficPolicyInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrafficPolicyInstance x -> TrafficPolicyInstance
$cfrom :: forall x. TrafficPolicyInstance -> Rep TrafficPolicyInstance x
Prelude.Generic)
newTrafficPolicyInstance ::
Prelude.Text ->
ResourceId ->
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
RRType ->
TrafficPolicyInstance
newTrafficPolicyInstance :: Text
-> ResourceId
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance
newTrafficPolicyInstance
Text
pId_
ResourceId
pHostedZoneId_
Text
pName_
Natural
pTTL_
Text
pState_
Text
pMessage_
Text
pTrafficPolicyId_
Natural
pTrafficPolicyVersion_
RRType
pTrafficPolicyType_ =
TrafficPolicyInstance' :: Text
-> ResourceId
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance
TrafficPolicyInstance'
{ $sel:id:TrafficPolicyInstance' :: Text
id = Text
pId_,
$sel:hostedZoneId:TrafficPolicyInstance' :: ResourceId
hostedZoneId = ResourceId
pHostedZoneId_,
$sel:name:TrafficPolicyInstance' :: Text
name = Text
pName_,
$sel:ttl:TrafficPolicyInstance' :: Natural
ttl = Natural
pTTL_,
$sel:state:TrafficPolicyInstance' :: Text
state = Text
pState_,
$sel:message:TrafficPolicyInstance' :: Text
message = Text
pMessage_,
$sel:trafficPolicyId:TrafficPolicyInstance' :: Text
trafficPolicyId = Text
pTrafficPolicyId_,
$sel:trafficPolicyVersion:TrafficPolicyInstance' :: Natural
trafficPolicyVersion = Natural
pTrafficPolicyVersion_,
$sel:trafficPolicyType:TrafficPolicyInstance' :: RRType
trafficPolicyType = RRType
pTrafficPolicyType_
}
trafficPolicyInstance_id :: Lens.Lens' TrafficPolicyInstance Prelude.Text
trafficPolicyInstance_id :: (Text -> f Text)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_id = (TrafficPolicyInstance -> Text)
-> (TrafficPolicyInstance -> Text -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Text
id :: Text
$sel:id:TrafficPolicyInstance' :: TrafficPolicyInstance -> Text
id} -> Text
id) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Text
a -> TrafficPolicyInstance
s {$sel:id:TrafficPolicyInstance' :: Text
id = Text
a} :: TrafficPolicyInstance)
trafficPolicyInstance_hostedZoneId :: Lens.Lens' TrafficPolicyInstance ResourceId
trafficPolicyInstance_hostedZoneId :: (ResourceId -> f ResourceId)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_hostedZoneId = (TrafficPolicyInstance -> ResourceId)
-> (TrafficPolicyInstance -> ResourceId -> TrafficPolicyInstance)
-> Lens
TrafficPolicyInstance TrafficPolicyInstance ResourceId ResourceId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {ResourceId
hostedZoneId :: ResourceId
$sel:hostedZoneId:TrafficPolicyInstance' :: TrafficPolicyInstance -> ResourceId
hostedZoneId} -> ResourceId
hostedZoneId) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} ResourceId
a -> TrafficPolicyInstance
s {$sel:hostedZoneId:TrafficPolicyInstance' :: ResourceId
hostedZoneId = ResourceId
a} :: TrafficPolicyInstance)
trafficPolicyInstance_name :: Lens.Lens' TrafficPolicyInstance Prelude.Text
trafficPolicyInstance_name :: (Text -> f Text)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_name = (TrafficPolicyInstance -> Text)
-> (TrafficPolicyInstance -> Text -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Text
name :: Text
$sel:name:TrafficPolicyInstance' :: TrafficPolicyInstance -> Text
name} -> Text
name) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Text
a -> TrafficPolicyInstance
s {$sel:name:TrafficPolicyInstance' :: Text
name = Text
a} :: TrafficPolicyInstance)
trafficPolicyInstance_ttl :: Lens.Lens' TrafficPolicyInstance Prelude.Natural
trafficPolicyInstance_ttl :: (Natural -> f Natural)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_ttl = (TrafficPolicyInstance -> Natural)
-> (TrafficPolicyInstance -> Natural -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Natural
ttl :: Natural
$sel:ttl:TrafficPolicyInstance' :: TrafficPolicyInstance -> Natural
ttl} -> Natural
ttl) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Natural
a -> TrafficPolicyInstance
s {$sel:ttl:TrafficPolicyInstance' :: Natural
ttl = Natural
a} :: TrafficPolicyInstance)
trafficPolicyInstance_state :: Lens.Lens' TrafficPolicyInstance Prelude.Text
trafficPolicyInstance_state :: (Text -> f Text)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_state = (TrafficPolicyInstance -> Text)
-> (TrafficPolicyInstance -> Text -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Text
state :: Text
$sel:state:TrafficPolicyInstance' :: TrafficPolicyInstance -> Text
state} -> Text
state) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Text
a -> TrafficPolicyInstance
s {$sel:state:TrafficPolicyInstance' :: Text
state = Text
a} :: TrafficPolicyInstance)
trafficPolicyInstance_message :: Lens.Lens' TrafficPolicyInstance Prelude.Text
trafficPolicyInstance_message :: (Text -> f Text)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_message = (TrafficPolicyInstance -> Text)
-> (TrafficPolicyInstance -> Text -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Text
message :: Text
$sel:message:TrafficPolicyInstance' :: TrafficPolicyInstance -> Text
message} -> Text
message) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Text
a -> TrafficPolicyInstance
s {$sel:message:TrafficPolicyInstance' :: Text
message = Text
a} :: TrafficPolicyInstance)
trafficPolicyInstance_trafficPolicyId :: Lens.Lens' TrafficPolicyInstance Prelude.Text
trafficPolicyInstance_trafficPolicyId :: (Text -> f Text)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_trafficPolicyId = (TrafficPolicyInstance -> Text)
-> (TrafficPolicyInstance -> Text -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Text
trafficPolicyId :: Text
$sel:trafficPolicyId:TrafficPolicyInstance' :: TrafficPolicyInstance -> Text
trafficPolicyId} -> Text
trafficPolicyId) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Text
a -> TrafficPolicyInstance
s {$sel:trafficPolicyId:TrafficPolicyInstance' :: Text
trafficPolicyId = Text
a} :: TrafficPolicyInstance)
trafficPolicyInstance_trafficPolicyVersion :: Lens.Lens' TrafficPolicyInstance Prelude.Natural
trafficPolicyInstance_trafficPolicyVersion :: (Natural -> f Natural)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_trafficPolicyVersion = (TrafficPolicyInstance -> Natural)
-> (TrafficPolicyInstance -> Natural -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {Natural
trafficPolicyVersion :: Natural
$sel:trafficPolicyVersion:TrafficPolicyInstance' :: TrafficPolicyInstance -> Natural
trafficPolicyVersion} -> Natural
trafficPolicyVersion) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} Natural
a -> TrafficPolicyInstance
s {$sel:trafficPolicyVersion:TrafficPolicyInstance' :: Natural
trafficPolicyVersion = Natural
a} :: TrafficPolicyInstance)
trafficPolicyInstance_trafficPolicyType :: Lens.Lens' TrafficPolicyInstance RRType
trafficPolicyInstance_trafficPolicyType :: (RRType -> f RRType)
-> TrafficPolicyInstance -> f TrafficPolicyInstance
trafficPolicyInstance_trafficPolicyType = (TrafficPolicyInstance -> RRType)
-> (TrafficPolicyInstance -> RRType -> TrafficPolicyInstance)
-> Lens TrafficPolicyInstance TrafficPolicyInstance RRType RRType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicyInstance' {RRType
trafficPolicyType :: RRType
$sel:trafficPolicyType:TrafficPolicyInstance' :: TrafficPolicyInstance -> RRType
trafficPolicyType} -> RRType
trafficPolicyType) (\s :: TrafficPolicyInstance
s@TrafficPolicyInstance' {} RRType
a -> TrafficPolicyInstance
s {$sel:trafficPolicyType:TrafficPolicyInstance' :: RRType
trafficPolicyType = RRType
a} :: TrafficPolicyInstance)
instance Core.FromXML TrafficPolicyInstance where
parseXML :: [Node] -> Either String TrafficPolicyInstance
parseXML [Node]
x =
Text
-> ResourceId
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance
TrafficPolicyInstance'
(Text
-> ResourceId
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
-> Either String Text
-> Either
String
(ResourceId
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
forall (f :: * -> *) a b. Functor 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
"Id")
Either
String
(ResourceId
-> Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
-> Either String ResourceId
-> Either
String
(Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
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
"HostedZoneId")
Either
String
(Text
-> Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
-> Either String Text
-> Either
String
(Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
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
(Natural
-> Text
-> Text
-> Text
-> Natural
-> RRType
-> TrafficPolicyInstance)
-> Either String Natural
-> Either
String
(Text
-> Text -> Text -> Natural -> RRType -> TrafficPolicyInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TTL")
Either
String
(Text
-> Text -> Text -> Natural -> RRType -> TrafficPolicyInstance)
-> Either String Text
-> Either
String (Text -> Text -> Natural -> RRType -> TrafficPolicyInstance)
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
"State")
Either
String (Text -> Text -> Natural -> RRType -> TrafficPolicyInstance)
-> Either String Text
-> Either
String (Text -> Natural -> RRType -> TrafficPolicyInstance)
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
"Message")
Either String (Text -> Natural -> RRType -> TrafficPolicyInstance)
-> Either String Text
-> Either String (Natural -> RRType -> TrafficPolicyInstance)
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
"TrafficPolicyId")
Either String (Natural -> RRType -> TrafficPolicyInstance)
-> Either String Natural
-> Either String (RRType -> TrafficPolicyInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrafficPolicyVersion")
Either String (RRType -> TrafficPolicyInstance)
-> Either String RRType -> Either String TrafficPolicyInstance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String RRType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrafficPolicyType")
instance Prelude.Hashable TrafficPolicyInstance
instance Prelude.NFData TrafficPolicyInstance