{-# 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.TrafficPolicy 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 TrafficPolicy = TrafficPolicy'
{
:: Prelude.Maybe Prelude.Text,
TrafficPolicy -> Text
id :: Prelude.Text,
TrafficPolicy -> Natural
version :: Prelude.Natural,
TrafficPolicy -> Text
name :: Prelude.Text,
TrafficPolicy -> RRType
type' :: RRType,
TrafficPolicy -> Text
document :: Prelude.Text
}
deriving (TrafficPolicy -> TrafficPolicy -> Bool
(TrafficPolicy -> TrafficPolicy -> Bool)
-> (TrafficPolicy -> TrafficPolicy -> Bool) -> Eq TrafficPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrafficPolicy -> TrafficPolicy -> Bool
$c/= :: TrafficPolicy -> TrafficPolicy -> Bool
== :: TrafficPolicy -> TrafficPolicy -> Bool
$c== :: TrafficPolicy -> TrafficPolicy -> Bool
Prelude.Eq, ReadPrec [TrafficPolicy]
ReadPrec TrafficPolicy
Int -> ReadS TrafficPolicy
ReadS [TrafficPolicy]
(Int -> ReadS TrafficPolicy)
-> ReadS [TrafficPolicy]
-> ReadPrec TrafficPolicy
-> ReadPrec [TrafficPolicy]
-> Read TrafficPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrafficPolicy]
$creadListPrec :: ReadPrec [TrafficPolicy]
readPrec :: ReadPrec TrafficPolicy
$creadPrec :: ReadPrec TrafficPolicy
readList :: ReadS [TrafficPolicy]
$creadList :: ReadS [TrafficPolicy]
readsPrec :: Int -> ReadS TrafficPolicy
$creadsPrec :: Int -> ReadS TrafficPolicy
Prelude.Read, Int -> TrafficPolicy -> ShowS
[TrafficPolicy] -> ShowS
TrafficPolicy -> String
(Int -> TrafficPolicy -> ShowS)
-> (TrafficPolicy -> String)
-> ([TrafficPolicy] -> ShowS)
-> Show TrafficPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrafficPolicy] -> ShowS
$cshowList :: [TrafficPolicy] -> ShowS
show :: TrafficPolicy -> String
$cshow :: TrafficPolicy -> String
showsPrec :: Int -> TrafficPolicy -> ShowS
$cshowsPrec :: Int -> TrafficPolicy -> ShowS
Prelude.Show, (forall x. TrafficPolicy -> Rep TrafficPolicy x)
-> (forall x. Rep TrafficPolicy x -> TrafficPolicy)
-> Generic TrafficPolicy
forall x. Rep TrafficPolicy x -> TrafficPolicy
forall x. TrafficPolicy -> Rep TrafficPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrafficPolicy x -> TrafficPolicy
$cfrom :: forall x. TrafficPolicy -> Rep TrafficPolicy x
Prelude.Generic)
newTrafficPolicy ::
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
RRType ->
Prelude.Text ->
TrafficPolicy
newTrafficPolicy :: Text -> Natural -> Text -> RRType -> Text -> TrafficPolicy
newTrafficPolicy
Text
pId_
Natural
pVersion_
Text
pName_
RRType
pType_
Text
pDocument_ =
TrafficPolicy' :: Maybe Text
-> Text -> Natural -> Text -> RRType -> Text -> TrafficPolicy
TrafficPolicy'
{ $sel:comment:TrafficPolicy' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:TrafficPolicy' :: Text
id = Text
pId_,
$sel:version:TrafficPolicy' :: Natural
version = Natural
pVersion_,
$sel:name:TrafficPolicy' :: Text
name = Text
pName_,
$sel:type':TrafficPolicy' :: RRType
type' = RRType
pType_,
$sel:document:TrafficPolicy' :: Text
document = Text
pDocument_
}
trafficPolicy_comment :: Lens.Lens' TrafficPolicy (Prelude.Maybe Prelude.Text)
= (TrafficPolicy -> Maybe Text)
-> (TrafficPolicy -> Maybe Text -> TrafficPolicy)
-> Lens TrafficPolicy TrafficPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicy' {Maybe Text
comment :: Maybe Text
$sel:comment:TrafficPolicy' :: TrafficPolicy -> Maybe Text
comment} -> Maybe Text
comment) (\s :: TrafficPolicy
s@TrafficPolicy' {} Maybe Text
a -> TrafficPolicy
s {$sel:comment:TrafficPolicy' :: Maybe Text
comment = Maybe Text
a} :: TrafficPolicy)
trafficPolicy_id :: Lens.Lens' TrafficPolicy Prelude.Text
trafficPolicy_id :: (Text -> f Text) -> TrafficPolicy -> f TrafficPolicy
trafficPolicy_id = (TrafficPolicy -> Text)
-> (TrafficPolicy -> Text -> TrafficPolicy)
-> Lens TrafficPolicy TrafficPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicy' {Text
id :: Text
$sel:id:TrafficPolicy' :: TrafficPolicy -> Text
id} -> Text
id) (\s :: TrafficPolicy
s@TrafficPolicy' {} Text
a -> TrafficPolicy
s {$sel:id:TrafficPolicy' :: Text
id = Text
a} :: TrafficPolicy)
trafficPolicy_version :: Lens.Lens' TrafficPolicy Prelude.Natural
trafficPolicy_version :: (Natural -> f Natural) -> TrafficPolicy -> f TrafficPolicy
trafficPolicy_version = (TrafficPolicy -> Natural)
-> (TrafficPolicy -> Natural -> TrafficPolicy)
-> Lens TrafficPolicy TrafficPolicy Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicy' {Natural
version :: Natural
$sel:version:TrafficPolicy' :: TrafficPolicy -> Natural
version} -> Natural
version) (\s :: TrafficPolicy
s@TrafficPolicy' {} Natural
a -> TrafficPolicy
s {$sel:version:TrafficPolicy' :: Natural
version = Natural
a} :: TrafficPolicy)
trafficPolicy_name :: Lens.Lens' TrafficPolicy Prelude.Text
trafficPolicy_name :: (Text -> f Text) -> TrafficPolicy -> f TrafficPolicy
trafficPolicy_name = (TrafficPolicy -> Text)
-> (TrafficPolicy -> Text -> TrafficPolicy)
-> Lens TrafficPolicy TrafficPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicy' {Text
name :: Text
$sel:name:TrafficPolicy' :: TrafficPolicy -> Text
name} -> Text
name) (\s :: TrafficPolicy
s@TrafficPolicy' {} Text
a -> TrafficPolicy
s {$sel:name:TrafficPolicy' :: Text
name = Text
a} :: TrafficPolicy)
trafficPolicy_type :: Lens.Lens' TrafficPolicy RRType
trafficPolicy_type :: (RRType -> f RRType) -> TrafficPolicy -> f TrafficPolicy
trafficPolicy_type = (TrafficPolicy -> RRType)
-> (TrafficPolicy -> RRType -> TrafficPolicy)
-> Lens TrafficPolicy TrafficPolicy RRType RRType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicy' {RRType
type' :: RRType
$sel:type':TrafficPolicy' :: TrafficPolicy -> RRType
type'} -> RRType
type') (\s :: TrafficPolicy
s@TrafficPolicy' {} RRType
a -> TrafficPolicy
s {$sel:type':TrafficPolicy' :: RRType
type' = RRType
a} :: TrafficPolicy)
trafficPolicy_document :: Lens.Lens' TrafficPolicy Prelude.Text
trafficPolicy_document :: (Text -> f Text) -> TrafficPolicy -> f TrafficPolicy
trafficPolicy_document = (TrafficPolicy -> Text)
-> (TrafficPolicy -> Text -> TrafficPolicy)
-> Lens TrafficPolicy TrafficPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicy' {Text
document :: Text
$sel:document:TrafficPolicy' :: TrafficPolicy -> Text
document} -> Text
document) (\s :: TrafficPolicy
s@TrafficPolicy' {} Text
a -> TrafficPolicy
s {$sel:document:TrafficPolicy' :: Text
document = Text
a} :: TrafficPolicy)
instance Core.FromXML TrafficPolicy where
parseXML :: [Node] -> Either String TrafficPolicy
parseXML [Node]
x =
Maybe Text
-> Text -> Natural -> Text -> RRType -> Text -> TrafficPolicy
TrafficPolicy'
(Maybe Text
-> Text -> Natural -> Text -> RRType -> Text -> TrafficPolicy)
-> Either String (Maybe Text)
-> Either
String (Text -> Natural -> Text -> RRType -> Text -> TrafficPolicy)
forall (f :: * -> *) a b. Functor 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")
Either
String (Text -> Natural -> Text -> RRType -> Text -> TrafficPolicy)
-> Either String Text
-> Either
String (Natural -> Text -> RRType -> Text -> TrafficPolicy)
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
"Id")
Either String (Natural -> Text -> RRType -> Text -> TrafficPolicy)
-> Either String Natural
-> Either String (Text -> RRType -> Text -> TrafficPolicy)
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
"Version")
Either String (Text -> RRType -> Text -> TrafficPolicy)
-> Either String Text
-> Either String (RRType -> Text -> TrafficPolicy)
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 (RRType -> Text -> TrafficPolicy)
-> Either String RRType -> Either String (Text -> TrafficPolicy)
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
"Type")
Either String (Text -> TrafficPolicy)
-> Either String Text -> Either String TrafficPolicy
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
"Document")
instance Prelude.Hashable TrafficPolicy
instance Prelude.NFData TrafficPolicy