{-# 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.TrafficPolicySummary 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 TrafficPolicySummary = TrafficPolicySummary'
{
TrafficPolicySummary -> Text
id :: Prelude.Text,
TrafficPolicySummary -> Text
name :: Prelude.Text,
TrafficPolicySummary -> RRType
type' :: RRType,
TrafficPolicySummary -> Natural
latestVersion :: Prelude.Natural,
TrafficPolicySummary -> Natural
trafficPolicyCount :: Prelude.Natural
}
deriving (TrafficPolicySummary -> TrafficPolicySummary -> Bool
(TrafficPolicySummary -> TrafficPolicySummary -> Bool)
-> (TrafficPolicySummary -> TrafficPolicySummary -> Bool)
-> Eq TrafficPolicySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrafficPolicySummary -> TrafficPolicySummary -> Bool
$c/= :: TrafficPolicySummary -> TrafficPolicySummary -> Bool
== :: TrafficPolicySummary -> TrafficPolicySummary -> Bool
$c== :: TrafficPolicySummary -> TrafficPolicySummary -> Bool
Prelude.Eq, ReadPrec [TrafficPolicySummary]
ReadPrec TrafficPolicySummary
Int -> ReadS TrafficPolicySummary
ReadS [TrafficPolicySummary]
(Int -> ReadS TrafficPolicySummary)
-> ReadS [TrafficPolicySummary]
-> ReadPrec TrafficPolicySummary
-> ReadPrec [TrafficPolicySummary]
-> Read TrafficPolicySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrafficPolicySummary]
$creadListPrec :: ReadPrec [TrafficPolicySummary]
readPrec :: ReadPrec TrafficPolicySummary
$creadPrec :: ReadPrec TrafficPolicySummary
readList :: ReadS [TrafficPolicySummary]
$creadList :: ReadS [TrafficPolicySummary]
readsPrec :: Int -> ReadS TrafficPolicySummary
$creadsPrec :: Int -> ReadS TrafficPolicySummary
Prelude.Read, Int -> TrafficPolicySummary -> ShowS
[TrafficPolicySummary] -> ShowS
TrafficPolicySummary -> String
(Int -> TrafficPolicySummary -> ShowS)
-> (TrafficPolicySummary -> String)
-> ([TrafficPolicySummary] -> ShowS)
-> Show TrafficPolicySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrafficPolicySummary] -> ShowS
$cshowList :: [TrafficPolicySummary] -> ShowS
show :: TrafficPolicySummary -> String
$cshow :: TrafficPolicySummary -> String
showsPrec :: Int -> TrafficPolicySummary -> ShowS
$cshowsPrec :: Int -> TrafficPolicySummary -> ShowS
Prelude.Show, (forall x. TrafficPolicySummary -> Rep TrafficPolicySummary x)
-> (forall x. Rep TrafficPolicySummary x -> TrafficPolicySummary)
-> Generic TrafficPolicySummary
forall x. Rep TrafficPolicySummary x -> TrafficPolicySummary
forall x. TrafficPolicySummary -> Rep TrafficPolicySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrafficPolicySummary x -> TrafficPolicySummary
$cfrom :: forall x. TrafficPolicySummary -> Rep TrafficPolicySummary x
Prelude.Generic)
newTrafficPolicySummary ::
Prelude.Text ->
Prelude.Text ->
RRType ->
Prelude.Natural ->
Prelude.Natural ->
TrafficPolicySummary
newTrafficPolicySummary :: Text
-> Text -> RRType -> Natural -> Natural -> TrafficPolicySummary
newTrafficPolicySummary
Text
pId_
Text
pName_
RRType
pType_
Natural
pLatestVersion_
Natural
pTrafficPolicyCount_ =
TrafficPolicySummary' :: Text
-> Text -> RRType -> Natural -> Natural -> TrafficPolicySummary
TrafficPolicySummary'
{ $sel:id:TrafficPolicySummary' :: Text
id = Text
pId_,
$sel:name:TrafficPolicySummary' :: Text
name = Text
pName_,
$sel:type':TrafficPolicySummary' :: RRType
type' = RRType
pType_,
$sel:latestVersion:TrafficPolicySummary' :: Natural
latestVersion = Natural
pLatestVersion_,
$sel:trafficPolicyCount:TrafficPolicySummary' :: Natural
trafficPolicyCount = Natural
pTrafficPolicyCount_
}
trafficPolicySummary_id :: Lens.Lens' TrafficPolicySummary Prelude.Text
trafficPolicySummary_id :: (Text -> f Text) -> TrafficPolicySummary -> f TrafficPolicySummary
trafficPolicySummary_id = (TrafficPolicySummary -> Text)
-> (TrafficPolicySummary -> Text -> TrafficPolicySummary)
-> Lens TrafficPolicySummary TrafficPolicySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicySummary' {Text
id :: Text
$sel:id:TrafficPolicySummary' :: TrafficPolicySummary -> Text
id} -> Text
id) (\s :: TrafficPolicySummary
s@TrafficPolicySummary' {} Text
a -> TrafficPolicySummary
s {$sel:id:TrafficPolicySummary' :: Text
id = Text
a} :: TrafficPolicySummary)
trafficPolicySummary_name :: Lens.Lens' TrafficPolicySummary Prelude.Text
trafficPolicySummary_name :: (Text -> f Text) -> TrafficPolicySummary -> f TrafficPolicySummary
trafficPolicySummary_name = (TrafficPolicySummary -> Text)
-> (TrafficPolicySummary -> Text -> TrafficPolicySummary)
-> Lens TrafficPolicySummary TrafficPolicySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicySummary' {Text
name :: Text
$sel:name:TrafficPolicySummary' :: TrafficPolicySummary -> Text
name} -> Text
name) (\s :: TrafficPolicySummary
s@TrafficPolicySummary' {} Text
a -> TrafficPolicySummary
s {$sel:name:TrafficPolicySummary' :: Text
name = Text
a} :: TrafficPolicySummary)
trafficPolicySummary_type :: Lens.Lens' TrafficPolicySummary RRType
trafficPolicySummary_type :: (RRType -> f RRType)
-> TrafficPolicySummary -> f TrafficPolicySummary
trafficPolicySummary_type = (TrafficPolicySummary -> RRType)
-> (TrafficPolicySummary -> RRType -> TrafficPolicySummary)
-> Lens TrafficPolicySummary TrafficPolicySummary RRType RRType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicySummary' {RRType
type' :: RRType
$sel:type':TrafficPolicySummary' :: TrafficPolicySummary -> RRType
type'} -> RRType
type') (\s :: TrafficPolicySummary
s@TrafficPolicySummary' {} RRType
a -> TrafficPolicySummary
s {$sel:type':TrafficPolicySummary' :: RRType
type' = RRType
a} :: TrafficPolicySummary)
trafficPolicySummary_latestVersion :: Lens.Lens' TrafficPolicySummary Prelude.Natural
trafficPolicySummary_latestVersion :: (Natural -> f Natural)
-> TrafficPolicySummary -> f TrafficPolicySummary
trafficPolicySummary_latestVersion = (TrafficPolicySummary -> Natural)
-> (TrafficPolicySummary -> Natural -> TrafficPolicySummary)
-> Lens TrafficPolicySummary TrafficPolicySummary Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicySummary' {Natural
latestVersion :: Natural
$sel:latestVersion:TrafficPolicySummary' :: TrafficPolicySummary -> Natural
latestVersion} -> Natural
latestVersion) (\s :: TrafficPolicySummary
s@TrafficPolicySummary' {} Natural
a -> TrafficPolicySummary
s {$sel:latestVersion:TrafficPolicySummary' :: Natural
latestVersion = Natural
a} :: TrafficPolicySummary)
trafficPolicySummary_trafficPolicyCount :: Lens.Lens' TrafficPolicySummary Prelude.Natural
trafficPolicySummary_trafficPolicyCount :: (Natural -> f Natural)
-> TrafficPolicySummary -> f TrafficPolicySummary
trafficPolicySummary_trafficPolicyCount = (TrafficPolicySummary -> Natural)
-> (TrafficPolicySummary -> Natural -> TrafficPolicySummary)
-> Lens TrafficPolicySummary TrafficPolicySummary Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficPolicySummary' {Natural
trafficPolicyCount :: Natural
$sel:trafficPolicyCount:TrafficPolicySummary' :: TrafficPolicySummary -> Natural
trafficPolicyCount} -> Natural
trafficPolicyCount) (\s :: TrafficPolicySummary
s@TrafficPolicySummary' {} Natural
a -> TrafficPolicySummary
s {$sel:trafficPolicyCount:TrafficPolicySummary' :: Natural
trafficPolicyCount = Natural
a} :: TrafficPolicySummary)
instance Core.FromXML TrafficPolicySummary where
parseXML :: [Node] -> Either String TrafficPolicySummary
parseXML [Node]
x =
Text
-> Text -> RRType -> Natural -> Natural -> TrafficPolicySummary
TrafficPolicySummary'
(Text
-> Text -> RRType -> Natural -> Natural -> TrafficPolicySummary)
-> Either String Text
-> Either
String
(Text -> RRType -> Natural -> Natural -> TrafficPolicySummary)
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
(Text -> RRType -> Natural -> Natural -> TrafficPolicySummary)
-> Either String Text
-> Either
String (RRType -> Natural -> Natural -> TrafficPolicySummary)
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 -> Natural -> Natural -> TrafficPolicySummary)
-> Either String RRType
-> Either String (Natural -> Natural -> TrafficPolicySummary)
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 (Natural -> Natural -> TrafficPolicySummary)
-> Either String Natural
-> Either String (Natural -> TrafficPolicySummary)
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
"LatestVersion")
Either String (Natural -> TrafficPolicySummary)
-> Either String Natural -> Either String TrafficPolicySummary
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
"TrafficPolicyCount")
instance Prelude.Hashable TrafficPolicySummary
instance Prelude.NFData TrafficPolicySummary