{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53.Types.TrafficPolicyInstance
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | A complex type that contains settings for the new traffic policy
-- instance.
--
-- /See:/ 'newTrafficPolicyInstance' smart constructor.
data TrafficPolicyInstance = TrafficPolicyInstance'
  { -- | The ID that Amazon Route 53 assigned to the new traffic policy instance.
    TrafficPolicyInstance -> Text
id :: Prelude.Text,
    -- | The ID of the hosted zone that Amazon Route 53 created resource record
    -- sets in.
    TrafficPolicyInstance -> ResourceId
hostedZoneId :: ResourceId,
    -- | The DNS name, such as www.example.com, for which Amazon Route 53
    -- responds to queries by using the resource record sets that are
    -- associated with this traffic policy instance.
    TrafficPolicyInstance -> Text
name :: Prelude.Text,
    -- | The TTL that Amazon Route 53 assigned to all of the resource record sets
    -- that it created in the specified hosted zone.
    TrafficPolicyInstance -> Natural
ttl :: Prelude.Natural,
    -- | The value of @State@ is one of the following values:
    --
    -- [Applied]
    --     Amazon Route 53 has finished creating resource record sets, and
    --     changes have propagated to all Route 53 edge locations.
    --
    -- [Creating]
    --     Route 53 is creating the resource record sets. Use
    --     @GetTrafficPolicyInstance@ to confirm that the
    --     @CreateTrafficPolicyInstance@ request completed successfully.
    --
    -- [Failed]
    --     Route 53 wasn\'t able to create or update the resource record sets.
    --     When the value of @State@ is @Failed@, see @Message@ for an
    --     explanation of what caused the request to fail.
    TrafficPolicyInstance -> Text
state :: Prelude.Text,
    -- | If @State@ is @Failed@, an explanation of the reason for the failure. If
    -- @State@ is another value, @Message@ is empty.
    TrafficPolicyInstance -> Text
message :: Prelude.Text,
    -- | The ID of the traffic policy that Amazon Route 53 used to create
    -- resource record sets in the specified hosted zone.
    TrafficPolicyInstance -> Text
trafficPolicyId :: Prelude.Text,
    -- | The version of the traffic policy that Amazon Route 53 used to create
    -- resource record sets in the specified hosted zone.
    TrafficPolicyInstance -> Natural
trafficPolicyVersion :: Prelude.Natural,
    -- | The DNS type that Amazon Route 53 assigned to all of the resource record
    -- sets that it created for this traffic policy instance.
    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)

-- |
-- Create a value of 'TrafficPolicyInstance' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'id', 'trafficPolicyInstance_id' - The ID that Amazon Route 53 assigned to the new traffic policy instance.
--
-- 'hostedZoneId', 'trafficPolicyInstance_hostedZoneId' - The ID of the hosted zone that Amazon Route 53 created resource record
-- sets in.
--
-- 'name', 'trafficPolicyInstance_name' - The DNS name, such as www.example.com, for which Amazon Route 53
-- responds to queries by using the resource record sets that are
-- associated with this traffic policy instance.
--
-- 'ttl', 'trafficPolicyInstance_ttl' - The TTL that Amazon Route 53 assigned to all of the resource record sets
-- that it created in the specified hosted zone.
--
-- 'state', 'trafficPolicyInstance_state' - The value of @State@ is one of the following values:
--
-- [Applied]
--     Amazon Route 53 has finished creating resource record sets, and
--     changes have propagated to all Route 53 edge locations.
--
-- [Creating]
--     Route 53 is creating the resource record sets. Use
--     @GetTrafficPolicyInstance@ to confirm that the
--     @CreateTrafficPolicyInstance@ request completed successfully.
--
-- [Failed]
--     Route 53 wasn\'t able to create or update the resource record sets.
--     When the value of @State@ is @Failed@, see @Message@ for an
--     explanation of what caused the request to fail.
--
-- 'message', 'trafficPolicyInstance_message' - If @State@ is @Failed@, an explanation of the reason for the failure. If
-- @State@ is another value, @Message@ is empty.
--
-- 'trafficPolicyId', 'trafficPolicyInstance_trafficPolicyId' - The ID of the traffic policy that Amazon Route 53 used to create
-- resource record sets in the specified hosted zone.
--
-- 'trafficPolicyVersion', 'trafficPolicyInstance_trafficPolicyVersion' - The version of the traffic policy that Amazon Route 53 used to create
-- resource record sets in the specified hosted zone.
--
-- 'trafficPolicyType', 'trafficPolicyInstance_trafficPolicyType' - The DNS type that Amazon Route 53 assigned to all of the resource record
-- sets that it created for this traffic policy instance.
newTrafficPolicyInstance ::
  -- | 'id'
  Prelude.Text ->
  -- | 'hostedZoneId'
  ResourceId ->
  -- | 'name'
  Prelude.Text ->
  -- | 'ttl'
  Prelude.Natural ->
  -- | 'state'
  Prelude.Text ->
  -- | 'message'
  Prelude.Text ->
  -- | 'trafficPolicyId'
  Prelude.Text ->
  -- | 'trafficPolicyVersion'
  Prelude.Natural ->
  -- | 'trafficPolicyType'
  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_
      }

-- | The ID that Amazon Route 53 assigned to the new traffic policy instance.
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)

-- | The ID of the hosted zone that Amazon Route 53 created resource record
-- sets in.
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)

-- | The DNS name, such as www.example.com, for which Amazon Route 53
-- responds to queries by using the resource record sets that are
-- associated with this traffic policy instance.
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)

-- | The TTL that Amazon Route 53 assigned to all of the resource record sets
-- that it created in the specified hosted zone.
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)

-- | The value of @State@ is one of the following values:
--
-- [Applied]
--     Amazon Route 53 has finished creating resource record sets, and
--     changes have propagated to all Route 53 edge locations.
--
-- [Creating]
--     Route 53 is creating the resource record sets. Use
--     @GetTrafficPolicyInstance@ to confirm that the
--     @CreateTrafficPolicyInstance@ request completed successfully.
--
-- [Failed]
--     Route 53 wasn\'t able to create or update the resource record sets.
--     When the value of @State@ is @Failed@, see @Message@ for an
--     explanation of what caused the request to fail.
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)

-- | If @State@ is @Failed@, an explanation of the reason for the failure. If
-- @State@ is another value, @Message@ is empty.
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)

-- | The ID of the traffic policy that Amazon Route 53 used to create
-- resource record sets in the specified hosted zone.
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)

-- | The version of the traffic policy that Amazon Route 53 used to create
-- resource record sets in the specified hosted zone.
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)

-- | The DNS type that Amazon Route 53 assigned to all of the resource record
-- sets that it created for this traffic policy instance.
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