{-# 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.Vpc 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.Tag
import Amazonka.EC2.Types.Tenancy
import Amazonka.EC2.Types.VpcCidrBlockAssociation
import Amazonka.EC2.Types.VpcIpv6CidrBlockAssociation
import Amazonka.EC2.Types.VpcState
import qualified Amazonka.Prelude as Prelude
data Vpc = Vpc'
{
Vpc -> Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet :: Prelude.Maybe [VpcCidrBlockAssociation],
Vpc -> Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet :: Prelude.Maybe [VpcIpv6CidrBlockAssociation],
Vpc -> Maybe Bool
isDefault :: Prelude.Maybe Prelude.Bool,
Vpc -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
Vpc -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
Vpc -> Text
cidrBlock :: Prelude.Text,
Vpc -> Text
dhcpOptionsId :: Prelude.Text,
Vpc -> Tenancy
instanceTenancy :: Tenancy,
Vpc -> VpcState
state :: VpcState,
Vpc -> Text
vpcId :: Prelude.Text
}
deriving (Vpc -> Vpc -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Vpc -> Vpc -> Bool
$c/= :: Vpc -> Vpc -> Bool
== :: Vpc -> Vpc -> Bool
$c== :: Vpc -> Vpc -> Bool
Prelude.Eq, ReadPrec [Vpc]
ReadPrec Vpc
Int -> ReadS Vpc
ReadS [Vpc]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Vpc]
$creadListPrec :: ReadPrec [Vpc]
readPrec :: ReadPrec Vpc
$creadPrec :: ReadPrec Vpc
readList :: ReadS [Vpc]
$creadList :: ReadS [Vpc]
readsPrec :: Int -> ReadS Vpc
$creadsPrec :: Int -> ReadS Vpc
Prelude.Read, Int -> Vpc -> ShowS
[Vpc] -> ShowS
Vpc -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Vpc] -> ShowS
$cshowList :: [Vpc] -> ShowS
show :: Vpc -> String
$cshow :: Vpc -> String
showsPrec :: Int -> Vpc -> ShowS
$cshowsPrec :: Int -> Vpc -> ShowS
Prelude.Show, forall x. Rep Vpc x -> Vpc
forall x. Vpc -> Rep Vpc x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Vpc x -> Vpc
$cfrom :: forall x. Vpc -> Rep Vpc x
Prelude.Generic)
newVpc ::
Prelude.Text ->
Prelude.Text ->
Tenancy ->
VpcState ->
Prelude.Text ->
Vpc
newVpc :: Text -> Text -> Tenancy -> VpcState -> Text -> Vpc
newVpc
Text
pCidrBlock_
Text
pDhcpOptionsId_
Tenancy
pInstanceTenancy_
VpcState
pState_
Text
pVpcId_ =
Vpc'
{ $sel:cidrBlockAssociationSet:Vpc' :: Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet = forall a. Maybe a
Prelude.Nothing,
$sel:ipv6CidrBlockAssociationSet:Vpc' :: Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet = forall a. Maybe a
Prelude.Nothing,
$sel:isDefault:Vpc' :: Maybe Bool
isDefault = forall a. Maybe a
Prelude.Nothing,
$sel:ownerId:Vpc' :: Maybe Text
ownerId = forall a. Maybe a
Prelude.Nothing,
$sel:tags:Vpc' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:cidrBlock:Vpc' :: Text
cidrBlock = Text
pCidrBlock_,
$sel:dhcpOptionsId:Vpc' :: Text
dhcpOptionsId = Text
pDhcpOptionsId_,
$sel:instanceTenancy:Vpc' :: Tenancy
instanceTenancy = Tenancy
pInstanceTenancy_,
$sel:state:Vpc' :: VpcState
state = VpcState
pState_,
$sel:vpcId:Vpc' :: Text
vpcId = Text
pVpcId_
}
vpc_cidrBlockAssociationSet :: Lens.Lens' Vpc (Prelude.Maybe [VpcCidrBlockAssociation])
vpc_cidrBlockAssociationSet :: Lens' Vpc (Maybe [VpcCidrBlockAssociation])
vpc_cidrBlockAssociationSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet :: Maybe [VpcCidrBlockAssociation]
$sel:cidrBlockAssociationSet:Vpc' :: Vpc -> Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet} -> Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet) (\s :: Vpc
s@Vpc' {} Maybe [VpcCidrBlockAssociation]
a -> Vpc
s {$sel:cidrBlockAssociationSet:Vpc' :: Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet = Maybe [VpcCidrBlockAssociation]
a} :: Vpc) 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
vpc_ipv6CidrBlockAssociationSet :: Lens.Lens' Vpc (Prelude.Maybe [VpcIpv6CidrBlockAssociation])
vpc_ipv6CidrBlockAssociationSet :: Lens' Vpc (Maybe [VpcIpv6CidrBlockAssociation])
vpc_ipv6CidrBlockAssociationSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet :: Maybe [VpcIpv6CidrBlockAssociation]
$sel:ipv6CidrBlockAssociationSet:Vpc' :: Vpc -> Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet} -> Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet) (\s :: Vpc
s@Vpc' {} Maybe [VpcIpv6CidrBlockAssociation]
a -> Vpc
s {$sel:ipv6CidrBlockAssociationSet:Vpc' :: Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet = Maybe [VpcIpv6CidrBlockAssociation]
a} :: Vpc) 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
vpc_isDefault :: Lens.Lens' Vpc (Prelude.Maybe Prelude.Bool)
vpc_isDefault :: Lens' Vpc (Maybe Bool)
vpc_isDefault = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Maybe Bool
isDefault :: Maybe Bool
$sel:isDefault:Vpc' :: Vpc -> Maybe Bool
isDefault} -> Maybe Bool
isDefault) (\s :: Vpc
s@Vpc' {} Maybe Bool
a -> Vpc
s {$sel:isDefault:Vpc' :: Maybe Bool
isDefault = Maybe Bool
a} :: Vpc)
vpc_ownerId :: Lens.Lens' Vpc (Prelude.Maybe Prelude.Text)
vpc_ownerId :: Lens' Vpc (Maybe Text)
vpc_ownerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:Vpc' :: Vpc -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: Vpc
s@Vpc' {} Maybe Text
a -> Vpc
s {$sel:ownerId:Vpc' :: Maybe Text
ownerId = Maybe Text
a} :: Vpc)
vpc_tags :: Lens.Lens' Vpc (Prelude.Maybe [Tag])
vpc_tags :: Lens' Vpc (Maybe [Tag])
vpc_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Vpc' :: Vpc -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Vpc
s@Vpc' {} Maybe [Tag]
a -> Vpc
s {$sel:tags:Vpc' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Vpc) 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
vpc_cidrBlock :: Lens.Lens' Vpc Prelude.Text
vpc_cidrBlock :: Lens' Vpc Text
vpc_cidrBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Text
cidrBlock :: Text
$sel:cidrBlock:Vpc' :: Vpc -> Text
cidrBlock} -> Text
cidrBlock) (\s :: Vpc
s@Vpc' {} Text
a -> Vpc
s {$sel:cidrBlock:Vpc' :: Text
cidrBlock = Text
a} :: Vpc)
vpc_dhcpOptionsId :: Lens.Lens' Vpc Prelude.Text
vpc_dhcpOptionsId :: Lens' Vpc Text
vpc_dhcpOptionsId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Text
dhcpOptionsId :: Text
$sel:dhcpOptionsId:Vpc' :: Vpc -> Text
dhcpOptionsId} -> Text
dhcpOptionsId) (\s :: Vpc
s@Vpc' {} Text
a -> Vpc
s {$sel:dhcpOptionsId:Vpc' :: Text
dhcpOptionsId = Text
a} :: Vpc)
vpc_instanceTenancy :: Lens.Lens' Vpc Tenancy
vpc_instanceTenancy :: Lens' Vpc Tenancy
vpc_instanceTenancy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Tenancy
instanceTenancy :: Tenancy
$sel:instanceTenancy:Vpc' :: Vpc -> Tenancy
instanceTenancy} -> Tenancy
instanceTenancy) (\s :: Vpc
s@Vpc' {} Tenancy
a -> Vpc
s {$sel:instanceTenancy:Vpc' :: Tenancy
instanceTenancy = Tenancy
a} :: Vpc)
vpc_state :: Lens.Lens' Vpc VpcState
vpc_state :: Lens' Vpc VpcState
vpc_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {VpcState
state :: VpcState
$sel:state:Vpc' :: Vpc -> VpcState
state} -> VpcState
state) (\s :: Vpc
s@Vpc' {} VpcState
a -> Vpc
s {$sel:state:Vpc' :: VpcState
state = VpcState
a} :: Vpc)
vpc_vpcId :: Lens.Lens' Vpc Prelude.Text
vpc_vpcId :: Lens' Vpc Text
vpc_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vpc' {Text
vpcId :: Text
$sel:vpcId:Vpc' :: Vpc -> Text
vpcId} -> Text
vpcId) (\s :: Vpc
s@Vpc' {} Text
a -> Vpc
s {$sel:vpcId:Vpc' :: Text
vpcId = Text
a} :: Vpc)
instance Data.FromXML Vpc where
parseXML :: [Node] -> Either String Vpc
parseXML [Node]
x =
Maybe [VpcCidrBlockAssociation]
-> Maybe [VpcIpv6CidrBlockAssociation]
-> Maybe Bool
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Tenancy
-> VpcState
-> Text
-> Vpc
Vpc'
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
"cidrBlockAssociationSet"
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")
)
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
"ipv6CidrBlockAssociationSet"
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")
)
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
"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")
)
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
"cidrBlock")
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
"dhcpOptionsId")
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
"instanceTenancy")
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
"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 a
Data..@ Text
"vpcId")
instance Prelude.Hashable Vpc where
hashWithSalt :: Int -> Vpc -> Int
hashWithSalt Int
_salt Vpc' {Maybe Bool
Maybe [Tag]
Maybe [VpcCidrBlockAssociation]
Maybe [VpcIpv6CidrBlockAssociation]
Maybe Text
Text
Tenancy
VpcState
vpcId :: Text
state :: VpcState
instanceTenancy :: Tenancy
dhcpOptionsId :: Text
cidrBlock :: Text
tags :: Maybe [Tag]
ownerId :: Maybe Text
isDefault :: Maybe Bool
ipv6CidrBlockAssociationSet :: Maybe [VpcIpv6CidrBlockAssociation]
cidrBlockAssociationSet :: Maybe [VpcCidrBlockAssociation]
$sel:vpcId:Vpc' :: Vpc -> Text
$sel:state:Vpc' :: Vpc -> VpcState
$sel:instanceTenancy:Vpc' :: Vpc -> Tenancy
$sel:dhcpOptionsId:Vpc' :: Vpc -> Text
$sel:cidrBlock:Vpc' :: Vpc -> Text
$sel:tags:Vpc' :: Vpc -> Maybe [Tag]
$sel:ownerId:Vpc' :: Vpc -> Maybe Text
$sel:isDefault:Vpc' :: Vpc -> Maybe Bool
$sel:ipv6CidrBlockAssociationSet:Vpc' :: Vpc -> Maybe [VpcIpv6CidrBlockAssociation]
$sel:cidrBlockAssociationSet:Vpc' :: Vpc -> Maybe [VpcCidrBlockAssociation]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet
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 [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cidrBlock
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dhcpOptionsId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Tenancy
instanceTenancy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VpcState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcId
instance Prelude.NFData Vpc where
rnf :: Vpc -> ()
rnf Vpc' {Maybe Bool
Maybe [Tag]
Maybe [VpcCidrBlockAssociation]
Maybe [VpcIpv6CidrBlockAssociation]
Maybe Text
Text
Tenancy
VpcState
vpcId :: Text
state :: VpcState
instanceTenancy :: Tenancy
dhcpOptionsId :: Text
cidrBlock :: Text
tags :: Maybe [Tag]
ownerId :: Maybe Text
isDefault :: Maybe Bool
ipv6CidrBlockAssociationSet :: Maybe [VpcIpv6CidrBlockAssociation]
cidrBlockAssociationSet :: Maybe [VpcCidrBlockAssociation]
$sel:vpcId:Vpc' :: Vpc -> Text
$sel:state:Vpc' :: Vpc -> VpcState
$sel:instanceTenancy:Vpc' :: Vpc -> Tenancy
$sel:dhcpOptionsId:Vpc' :: Vpc -> Text
$sel:cidrBlock:Vpc' :: Vpc -> Text
$sel:tags:Vpc' :: Vpc -> Maybe [Tag]
$sel:ownerId:Vpc' :: Vpc -> Maybe Text
$sel:isDefault:Vpc' :: Vpc -> Maybe Bool
$sel:ipv6CidrBlockAssociationSet:Vpc' :: Vpc -> Maybe [VpcIpv6CidrBlockAssociation]
$sel:cidrBlockAssociationSet:Vpc' :: Vpc -> Maybe [VpcCidrBlockAssociation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpcCidrBlockAssociation]
cidrBlockAssociationSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpcIpv6CidrBlockAssociation]
ipv6CidrBlockAssociationSet
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 [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
cidrBlock
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dhcpOptionsId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Tenancy
instanceTenancy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VpcState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcId