{-# 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.CidrRoutingConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
data CidrRoutingConfig = CidrRoutingConfig'
{
CidrRoutingConfig -> Text
collectionId :: Prelude.Text,
CidrRoutingConfig -> Text
locationName :: Prelude.Text
}
deriving (CidrRoutingConfig -> CidrRoutingConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CidrRoutingConfig -> CidrRoutingConfig -> Bool
$c/= :: CidrRoutingConfig -> CidrRoutingConfig -> Bool
== :: CidrRoutingConfig -> CidrRoutingConfig -> Bool
$c== :: CidrRoutingConfig -> CidrRoutingConfig -> Bool
Prelude.Eq, ReadPrec [CidrRoutingConfig]
ReadPrec CidrRoutingConfig
Int -> ReadS CidrRoutingConfig
ReadS [CidrRoutingConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CidrRoutingConfig]
$creadListPrec :: ReadPrec [CidrRoutingConfig]
readPrec :: ReadPrec CidrRoutingConfig
$creadPrec :: ReadPrec CidrRoutingConfig
readList :: ReadS [CidrRoutingConfig]
$creadList :: ReadS [CidrRoutingConfig]
readsPrec :: Int -> ReadS CidrRoutingConfig
$creadsPrec :: Int -> ReadS CidrRoutingConfig
Prelude.Read, Int -> CidrRoutingConfig -> ShowS
[CidrRoutingConfig] -> ShowS
CidrRoutingConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CidrRoutingConfig] -> ShowS
$cshowList :: [CidrRoutingConfig] -> ShowS
show :: CidrRoutingConfig -> String
$cshow :: CidrRoutingConfig -> String
showsPrec :: Int -> CidrRoutingConfig -> ShowS
$cshowsPrec :: Int -> CidrRoutingConfig -> ShowS
Prelude.Show, forall x. Rep CidrRoutingConfig x -> CidrRoutingConfig
forall x. CidrRoutingConfig -> Rep CidrRoutingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CidrRoutingConfig x -> CidrRoutingConfig
$cfrom :: forall x. CidrRoutingConfig -> Rep CidrRoutingConfig x
Prelude.Generic)
newCidrRoutingConfig ::
Prelude.Text ->
Prelude.Text ->
CidrRoutingConfig
newCidrRoutingConfig :: Text -> Text -> CidrRoutingConfig
newCidrRoutingConfig Text
pCollectionId_ Text
pLocationName_ =
CidrRoutingConfig'
{ $sel:collectionId:CidrRoutingConfig' :: Text
collectionId = Text
pCollectionId_,
$sel:locationName:CidrRoutingConfig' :: Text
locationName = Text
pLocationName_
}
cidrRoutingConfig_collectionId :: Lens.Lens' CidrRoutingConfig Prelude.Text
cidrRoutingConfig_collectionId :: Lens' CidrRoutingConfig Text
cidrRoutingConfig_collectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CidrRoutingConfig' {Text
collectionId :: Text
$sel:collectionId:CidrRoutingConfig' :: CidrRoutingConfig -> Text
collectionId} -> Text
collectionId) (\s :: CidrRoutingConfig
s@CidrRoutingConfig' {} Text
a -> CidrRoutingConfig
s {$sel:collectionId:CidrRoutingConfig' :: Text
collectionId = Text
a} :: CidrRoutingConfig)
cidrRoutingConfig_locationName :: Lens.Lens' CidrRoutingConfig Prelude.Text
cidrRoutingConfig_locationName :: Lens' CidrRoutingConfig Text
cidrRoutingConfig_locationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CidrRoutingConfig' {Text
locationName :: Text
$sel:locationName:CidrRoutingConfig' :: CidrRoutingConfig -> Text
locationName} -> Text
locationName) (\s :: CidrRoutingConfig
s@CidrRoutingConfig' {} Text
a -> CidrRoutingConfig
s {$sel:locationName:CidrRoutingConfig' :: Text
locationName = Text
a} :: CidrRoutingConfig)
instance Data.FromXML CidrRoutingConfig where
parseXML :: [Node] -> Either String CidrRoutingConfig
parseXML [Node]
x =
Text -> Text -> CidrRoutingConfig
CidrRoutingConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CollectionId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LocationName")
instance Prelude.Hashable CidrRoutingConfig where
hashWithSalt :: Int -> CidrRoutingConfig -> Int
hashWithSalt Int
_salt CidrRoutingConfig' {Text
locationName :: Text
collectionId :: Text
$sel:locationName:CidrRoutingConfig' :: CidrRoutingConfig -> Text
$sel:collectionId:CidrRoutingConfig' :: CidrRoutingConfig -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
collectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
locationName
instance Prelude.NFData CidrRoutingConfig where
rnf :: CidrRoutingConfig -> ()
rnf CidrRoutingConfig' {Text
locationName :: Text
collectionId :: Text
$sel:locationName:CidrRoutingConfig' :: CidrRoutingConfig -> Text
$sel:collectionId:CidrRoutingConfig' :: CidrRoutingConfig -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
collectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
locationName
instance Data.ToXML CidrRoutingConfig where
toXML :: CidrRoutingConfig -> XML
toXML CidrRoutingConfig' {Text
locationName :: Text
collectionId :: Text
$sel:locationName:CidrRoutingConfig' :: CidrRoutingConfig -> Text
$sel:collectionId:CidrRoutingConfig' :: CidrRoutingConfig -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"CollectionId" forall a. ToXML a => Name -> a -> XML
Data.@= Text
collectionId,
Name
"LocationName" forall a. ToXML a => Name -> a -> XML
Data.@= Text
locationName
]