{-# 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.EC2.Types.IpamScope where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.IpamScopeState
import Amazonka.EC2.Types.IpamScopeType
import Amazonka.EC2.Types.Tag
import qualified Amazonka.Prelude as Prelude
data IpamScope = IpamScope'
{
IpamScope -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
IpamScope -> Maybe Text
ipamArn :: Prelude.Maybe Prelude.Text,
IpamScope -> Maybe Text
ipamRegion :: Prelude.Maybe Prelude.Text,
IpamScope -> Maybe Text
ipamScopeArn :: Prelude.Maybe Prelude.Text,
IpamScope -> Maybe Text
ipamScopeId :: Prelude.Maybe Prelude.Text,
IpamScope -> Maybe IpamScopeType
ipamScopeType :: Prelude.Maybe IpamScopeType,
IpamScope -> Maybe Bool
isDefault :: Prelude.Maybe Prelude.Bool,
IpamScope -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
IpamScope -> Maybe Int
poolCount :: Prelude.Maybe Prelude.Int,
IpamScope -> Maybe IpamScopeState
state :: Prelude.Maybe IpamScopeState,
IpamScope -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (IpamScope -> IpamScope -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpamScope -> IpamScope -> Bool
$c/= :: IpamScope -> IpamScope -> Bool
== :: IpamScope -> IpamScope -> Bool
$c== :: IpamScope -> IpamScope -> Bool
Prelude.Eq, ReadPrec [IpamScope]
ReadPrec IpamScope
Int -> ReadS IpamScope
ReadS [IpamScope]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpamScope]
$creadListPrec :: ReadPrec [IpamScope]
readPrec :: ReadPrec IpamScope
$creadPrec :: ReadPrec IpamScope
readList :: ReadS [IpamScope]
$creadList :: ReadS [IpamScope]
readsPrec :: Int -> ReadS IpamScope
$creadsPrec :: Int -> ReadS IpamScope
Prelude.Read, Int -> IpamScope -> ShowS
[IpamScope] -> ShowS
IpamScope -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpamScope] -> ShowS
$cshowList :: [IpamScope] -> ShowS
show :: IpamScope -> String
$cshow :: IpamScope -> String
showsPrec :: Int -> IpamScope -> ShowS
$cshowsPrec :: Int -> IpamScope -> ShowS
Prelude.Show, forall x. Rep IpamScope x -> IpamScope
forall x. IpamScope -> Rep IpamScope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpamScope x -> IpamScope
$cfrom :: forall x. IpamScope -> Rep IpamScope x
Prelude.Generic)
newIpamScope ::
IpamScope
newIpamScope :: IpamScope
newIpamScope =
IpamScope'
{ $sel:description:IpamScope' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:ipamArn:IpamScope' :: Maybe Text
ipamArn = forall a. Maybe a
Prelude.Nothing,
$sel:ipamRegion:IpamScope' :: Maybe Text
ipamRegion = forall a. Maybe a
Prelude.Nothing,
$sel:ipamScopeArn:IpamScope' :: Maybe Text
ipamScopeArn = forall a. Maybe a
Prelude.Nothing,
$sel:ipamScopeId:IpamScope' :: Maybe Text
ipamScopeId = forall a. Maybe a
Prelude.Nothing,
$sel:ipamScopeType:IpamScope' :: Maybe IpamScopeType
ipamScopeType = forall a. Maybe a
Prelude.Nothing,
$sel:isDefault:IpamScope' :: Maybe Bool
isDefault = forall a. Maybe a
Prelude.Nothing,
$sel:ownerId:IpamScope' :: Maybe Text
ownerId = forall a. Maybe a
Prelude.Nothing,
$sel:poolCount:IpamScope' :: Maybe Int
poolCount = forall a. Maybe a
Prelude.Nothing,
$sel:state:IpamScope' :: Maybe IpamScopeState
state = forall a. Maybe a
Prelude.Nothing,
$sel:tags:IpamScope' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
}
ipamScope_description :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Text)
ipamScope_description :: Lens' IpamScope (Maybe Text)
ipamScope_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Text
description :: Maybe Text
$sel:description:IpamScope' :: IpamScope -> Maybe Text
description} -> Maybe Text
description) (\s :: IpamScope
s@IpamScope' {} Maybe Text
a -> IpamScope
s {$sel:description:IpamScope' :: Maybe Text
description = Maybe Text
a} :: IpamScope)
ipamScope_ipamArn :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Text)
ipamScope_ipamArn :: Lens' IpamScope (Maybe Text)
ipamScope_ipamArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Text
ipamArn :: Maybe Text
$sel:ipamArn:IpamScope' :: IpamScope -> Maybe Text
ipamArn} -> Maybe Text
ipamArn) (\s :: IpamScope
s@IpamScope' {} Maybe Text
a -> IpamScope
s {$sel:ipamArn:IpamScope' :: Maybe Text
ipamArn = Maybe Text
a} :: IpamScope)
ipamScope_ipamRegion :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Text)
ipamScope_ipamRegion :: Lens' IpamScope (Maybe Text)
ipamScope_ipamRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Text
ipamRegion :: Maybe Text
$sel:ipamRegion:IpamScope' :: IpamScope -> Maybe Text
ipamRegion} -> Maybe Text
ipamRegion) (\s :: IpamScope
s@IpamScope' {} Maybe Text
a -> IpamScope
s {$sel:ipamRegion:IpamScope' :: Maybe Text
ipamRegion = Maybe Text
a} :: IpamScope)
ipamScope_ipamScopeArn :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Text)
ipamScope_ipamScopeArn :: Lens' IpamScope (Maybe Text)
ipamScope_ipamScopeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Text
ipamScopeArn :: Maybe Text
$sel:ipamScopeArn:IpamScope' :: IpamScope -> Maybe Text
ipamScopeArn} -> Maybe Text
ipamScopeArn) (\s :: IpamScope
s@IpamScope' {} Maybe Text
a -> IpamScope
s {$sel:ipamScopeArn:IpamScope' :: Maybe Text
ipamScopeArn = Maybe Text
a} :: IpamScope)
ipamScope_ipamScopeId :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Text)
ipamScope_ipamScopeId :: Lens' IpamScope (Maybe Text)
ipamScope_ipamScopeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Text
ipamScopeId :: Maybe Text
$sel:ipamScopeId:IpamScope' :: IpamScope -> Maybe Text
ipamScopeId} -> Maybe Text
ipamScopeId) (\s :: IpamScope
s@IpamScope' {} Maybe Text
a -> IpamScope
s {$sel:ipamScopeId:IpamScope' :: Maybe Text
ipamScopeId = Maybe Text
a} :: IpamScope)
ipamScope_ipamScopeType :: Lens.Lens' IpamScope (Prelude.Maybe IpamScopeType)
ipamScope_ipamScopeType :: Lens' IpamScope (Maybe IpamScopeType)
ipamScope_ipamScopeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe IpamScopeType
ipamScopeType :: Maybe IpamScopeType
$sel:ipamScopeType:IpamScope' :: IpamScope -> Maybe IpamScopeType
ipamScopeType} -> Maybe IpamScopeType
ipamScopeType) (\s :: IpamScope
s@IpamScope' {} Maybe IpamScopeType
a -> IpamScope
s {$sel:ipamScopeType:IpamScope' :: Maybe IpamScopeType
ipamScopeType = Maybe IpamScopeType
a} :: IpamScope)
ipamScope_isDefault :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Bool)
ipamScope_isDefault :: Lens' IpamScope (Maybe Bool)
ipamScope_isDefault = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Bool
isDefault :: Maybe Bool
$sel:isDefault:IpamScope' :: IpamScope -> Maybe Bool
isDefault} -> Maybe Bool
isDefault) (\s :: IpamScope
s@IpamScope' {} Maybe Bool
a -> IpamScope
s {$sel:isDefault:IpamScope' :: Maybe Bool
isDefault = Maybe Bool
a} :: IpamScope)
ipamScope_ownerId :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Text)
ipamScope_ownerId :: Lens' IpamScope (Maybe Text)
ipamScope_ownerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:IpamScope' :: IpamScope -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: IpamScope
s@IpamScope' {} Maybe Text
a -> IpamScope
s {$sel:ownerId:IpamScope' :: Maybe Text
ownerId = Maybe Text
a} :: IpamScope)
ipamScope_poolCount :: Lens.Lens' IpamScope (Prelude.Maybe Prelude.Int)
ipamScope_poolCount :: Lens' IpamScope (Maybe Int)
ipamScope_poolCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe Int
poolCount :: Maybe Int
$sel:poolCount:IpamScope' :: IpamScope -> Maybe Int
poolCount} -> Maybe Int
poolCount) (\s :: IpamScope
s@IpamScope' {} Maybe Int
a -> IpamScope
s {$sel:poolCount:IpamScope' :: Maybe Int
poolCount = Maybe Int
a} :: IpamScope)
ipamScope_state :: Lens.Lens' IpamScope (Prelude.Maybe IpamScopeState)
ipamScope_state :: Lens' IpamScope (Maybe IpamScopeState)
ipamScope_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe IpamScopeState
state :: Maybe IpamScopeState
$sel:state:IpamScope' :: IpamScope -> Maybe IpamScopeState
state} -> Maybe IpamScopeState
state) (\s :: IpamScope
s@IpamScope' {} Maybe IpamScopeState
a -> IpamScope
s {$sel:state:IpamScope' :: Maybe IpamScopeState
state = Maybe IpamScopeState
a} :: IpamScope)
ipamScope_tags :: Lens.Lens' IpamScope (Prelude.Maybe [Tag])
ipamScope_tags :: Lens' IpamScope (Maybe [Tag])
ipamScope_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpamScope' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:IpamScope' :: IpamScope -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: IpamScope
s@IpamScope' {} Maybe [Tag]
a -> IpamScope
s {$sel:tags:IpamScope' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: IpamScope) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromXML IpamScope where
parseXML :: [Node] -> Either String IpamScope
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IpamScopeType
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe IpamScopeState
-> Maybe [Tag]
-> IpamScope
IpamScope'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipamArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipamRegion")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipamScopeArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipamScopeId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipamScopeType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"isDefault")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ownerId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"poolCount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"state")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tagSet"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
)
instance Prelude.Hashable IpamScope where
hashWithSalt :: Int -> IpamScope -> Int
hashWithSalt Int
_salt IpamScope' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe Text
Maybe IpamScopeState
Maybe IpamScopeType
tags :: Maybe [Tag]
state :: Maybe IpamScopeState
poolCount :: Maybe Int
ownerId :: Maybe Text
isDefault :: Maybe Bool
ipamScopeType :: Maybe IpamScopeType
ipamScopeId :: Maybe Text
ipamScopeArn :: Maybe Text
ipamRegion :: Maybe Text
ipamArn :: Maybe Text
description :: Maybe Text
$sel:tags:IpamScope' :: IpamScope -> Maybe [Tag]
$sel:state:IpamScope' :: IpamScope -> Maybe IpamScopeState
$sel:poolCount:IpamScope' :: IpamScope -> Maybe Int
$sel:ownerId:IpamScope' :: IpamScope -> Maybe Text
$sel:isDefault:IpamScope' :: IpamScope -> Maybe Bool
$sel:ipamScopeType:IpamScope' :: IpamScope -> Maybe IpamScopeType
$sel:ipamScopeId:IpamScope' :: IpamScope -> Maybe Text
$sel:ipamScopeArn:IpamScope' :: IpamScope -> Maybe Text
$sel:ipamRegion:IpamScope' :: IpamScope -> Maybe Text
$sel:ipamArn:IpamScope' :: IpamScope -> Maybe Text
$sel:description:IpamScope' :: IpamScope -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipamArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipamRegion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipamScopeArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipamScopeId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpamScopeType
ipamScopeType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isDefault
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
poolCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpamScopeState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
instance Prelude.NFData IpamScope where
rnf :: IpamScope -> ()
rnf IpamScope' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe Text
Maybe IpamScopeState
Maybe IpamScopeType
tags :: Maybe [Tag]
state :: Maybe IpamScopeState
poolCount :: Maybe Int
ownerId :: Maybe Text
isDefault :: Maybe Bool
ipamScopeType :: Maybe IpamScopeType
ipamScopeId :: Maybe Text
ipamScopeArn :: Maybe Text
ipamRegion :: Maybe Text
ipamArn :: Maybe Text
description :: Maybe Text
$sel:tags:IpamScope' :: IpamScope -> Maybe [Tag]
$sel:state:IpamScope' :: IpamScope -> Maybe IpamScopeState
$sel:poolCount:IpamScope' :: IpamScope -> Maybe Int
$sel:ownerId:IpamScope' :: IpamScope -> Maybe Text
$sel:isDefault:IpamScope' :: IpamScope -> Maybe Bool
$sel:ipamScopeType:IpamScope' :: IpamScope -> Maybe IpamScopeType
$sel:ipamScopeId:IpamScope' :: IpamScope -> Maybe Text
$sel:ipamScopeArn:IpamScope' :: IpamScope -> Maybe Text
$sel:ipamRegion:IpamScope' :: IpamScope -> Maybe Text
$sel:ipamArn:IpamScope' :: IpamScope -> Maybe Text
$sel:description:IpamScope' :: IpamScope -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipamArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipamRegion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipamScopeArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipamScopeId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpamScopeType
ipamScopeType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isDefault
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
poolCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpamScopeState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags