{-# 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.KinesisAnalyticsV2.Types.VpcConfigurationDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VpcConfigurationDescription = VpcConfigurationDescription'
{
VpcConfigurationDescription -> Text
vpcConfigurationId :: Prelude.Text,
VpcConfigurationDescription -> Text
vpcId :: Prelude.Text,
VpcConfigurationDescription -> NonEmpty Text
subnetIds :: Prelude.NonEmpty Prelude.Text,
VpcConfigurationDescription -> NonEmpty Text
securityGroupIds :: Prelude.NonEmpty Prelude.Text
}
deriving (VpcConfigurationDescription -> VpcConfigurationDescription -> Bool
(VpcConfigurationDescription
-> VpcConfigurationDescription -> Bool)
-> (VpcConfigurationDescription
-> VpcConfigurationDescription -> Bool)
-> Eq VpcConfigurationDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcConfigurationDescription -> VpcConfigurationDescription -> Bool
$c/= :: VpcConfigurationDescription -> VpcConfigurationDescription -> Bool
== :: VpcConfigurationDescription -> VpcConfigurationDescription -> Bool
$c== :: VpcConfigurationDescription -> VpcConfigurationDescription -> Bool
Prelude.Eq, ReadPrec [VpcConfigurationDescription]
ReadPrec VpcConfigurationDescription
Int -> ReadS VpcConfigurationDescription
ReadS [VpcConfigurationDescription]
(Int -> ReadS VpcConfigurationDescription)
-> ReadS [VpcConfigurationDescription]
-> ReadPrec VpcConfigurationDescription
-> ReadPrec [VpcConfigurationDescription]
-> Read VpcConfigurationDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcConfigurationDescription]
$creadListPrec :: ReadPrec [VpcConfigurationDescription]
readPrec :: ReadPrec VpcConfigurationDescription
$creadPrec :: ReadPrec VpcConfigurationDescription
readList :: ReadS [VpcConfigurationDescription]
$creadList :: ReadS [VpcConfigurationDescription]
readsPrec :: Int -> ReadS VpcConfigurationDescription
$creadsPrec :: Int -> ReadS VpcConfigurationDescription
Prelude.Read, Int -> VpcConfigurationDescription -> ShowS
[VpcConfigurationDescription] -> ShowS
VpcConfigurationDescription -> String
(Int -> VpcConfigurationDescription -> ShowS)
-> (VpcConfigurationDescription -> String)
-> ([VpcConfigurationDescription] -> ShowS)
-> Show VpcConfigurationDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcConfigurationDescription] -> ShowS
$cshowList :: [VpcConfigurationDescription] -> ShowS
show :: VpcConfigurationDescription -> String
$cshow :: VpcConfigurationDescription -> String
showsPrec :: Int -> VpcConfigurationDescription -> ShowS
$cshowsPrec :: Int -> VpcConfigurationDescription -> ShowS
Prelude.Show, (forall x.
VpcConfigurationDescription -> Rep VpcConfigurationDescription x)
-> (forall x.
Rep VpcConfigurationDescription x -> VpcConfigurationDescription)
-> Generic VpcConfigurationDescription
forall x.
Rep VpcConfigurationDescription x -> VpcConfigurationDescription
forall x.
VpcConfigurationDescription -> Rep VpcConfigurationDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VpcConfigurationDescription x -> VpcConfigurationDescription
$cfrom :: forall x.
VpcConfigurationDescription -> Rep VpcConfigurationDescription x
Prelude.Generic)
newVpcConfigurationDescription ::
Prelude.Text ->
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
VpcConfigurationDescription
newVpcConfigurationDescription :: Text
-> Text
-> NonEmpty Text
-> NonEmpty Text
-> VpcConfigurationDescription
newVpcConfigurationDescription
Text
pVpcConfigurationId_
Text
pVpcId_
NonEmpty Text
pSubnetIds_
NonEmpty Text
pSecurityGroupIds_ =
VpcConfigurationDescription' :: Text
-> Text
-> NonEmpty Text
-> NonEmpty Text
-> VpcConfigurationDescription
VpcConfigurationDescription'
{ $sel:vpcConfigurationId:VpcConfigurationDescription' :: Text
vpcConfigurationId =
Text
pVpcConfigurationId_,
$sel:vpcId:VpcConfigurationDescription' :: Text
vpcId = Text
pVpcId_,
$sel:subnetIds:VpcConfigurationDescription' :: NonEmpty Text
subnetIds = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSubnetIds_,
$sel:securityGroupIds:VpcConfigurationDescription' :: NonEmpty Text
securityGroupIds =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSecurityGroupIds_
}
vpcConfigurationDescription_vpcConfigurationId :: Lens.Lens' VpcConfigurationDescription Prelude.Text
vpcConfigurationDescription_vpcConfigurationId :: (Text -> f Text)
-> VpcConfigurationDescription -> f VpcConfigurationDescription
vpcConfigurationDescription_vpcConfigurationId = (VpcConfigurationDescription -> Text)
-> (VpcConfigurationDescription
-> Text -> VpcConfigurationDescription)
-> Lens
VpcConfigurationDescription VpcConfigurationDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcConfigurationDescription' {Text
vpcConfigurationId :: Text
$sel:vpcConfigurationId:VpcConfigurationDescription' :: VpcConfigurationDescription -> Text
vpcConfigurationId} -> Text
vpcConfigurationId) (\s :: VpcConfigurationDescription
s@VpcConfigurationDescription' {} Text
a -> VpcConfigurationDescription
s {$sel:vpcConfigurationId:VpcConfigurationDescription' :: Text
vpcConfigurationId = Text
a} :: VpcConfigurationDescription)
vpcConfigurationDescription_vpcId :: Lens.Lens' VpcConfigurationDescription Prelude.Text
vpcConfigurationDescription_vpcId :: (Text -> f Text)
-> VpcConfigurationDescription -> f VpcConfigurationDescription
vpcConfigurationDescription_vpcId = (VpcConfigurationDescription -> Text)
-> (VpcConfigurationDescription
-> Text -> VpcConfigurationDescription)
-> Lens
VpcConfigurationDescription VpcConfigurationDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcConfigurationDescription' {Text
vpcId :: Text
$sel:vpcId:VpcConfigurationDescription' :: VpcConfigurationDescription -> Text
vpcId} -> Text
vpcId) (\s :: VpcConfigurationDescription
s@VpcConfigurationDescription' {} Text
a -> VpcConfigurationDescription
s {$sel:vpcId:VpcConfigurationDescription' :: Text
vpcId = Text
a} :: VpcConfigurationDescription)
vpcConfigurationDescription_subnetIds :: Lens.Lens' VpcConfigurationDescription (Prelude.NonEmpty Prelude.Text)
vpcConfigurationDescription_subnetIds :: (NonEmpty Text -> f (NonEmpty Text))
-> VpcConfigurationDescription -> f VpcConfigurationDescription
vpcConfigurationDescription_subnetIds = (VpcConfigurationDescription -> NonEmpty Text)
-> (VpcConfigurationDescription
-> NonEmpty Text -> VpcConfigurationDescription)
-> Lens
VpcConfigurationDescription
VpcConfigurationDescription
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcConfigurationDescription' {NonEmpty Text
subnetIds :: NonEmpty Text
$sel:subnetIds:VpcConfigurationDescription' :: VpcConfigurationDescription -> NonEmpty Text
subnetIds} -> NonEmpty Text
subnetIds) (\s :: VpcConfigurationDescription
s@VpcConfigurationDescription' {} NonEmpty Text
a -> VpcConfigurationDescription
s {$sel:subnetIds:VpcConfigurationDescription' :: NonEmpty Text
subnetIds = NonEmpty Text
a} :: VpcConfigurationDescription) ((NonEmpty Text -> f (NonEmpty Text))
-> VpcConfigurationDescription -> f VpcConfigurationDescription)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> VpcConfigurationDescription
-> f VpcConfigurationDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
vpcConfigurationDescription_securityGroupIds :: Lens.Lens' VpcConfigurationDescription (Prelude.NonEmpty Prelude.Text)
vpcConfigurationDescription_securityGroupIds :: (NonEmpty Text -> f (NonEmpty Text))
-> VpcConfigurationDescription -> f VpcConfigurationDescription
vpcConfigurationDescription_securityGroupIds = (VpcConfigurationDescription -> NonEmpty Text)
-> (VpcConfigurationDescription
-> NonEmpty Text -> VpcConfigurationDescription)
-> Lens
VpcConfigurationDescription
VpcConfigurationDescription
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcConfigurationDescription' {NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:securityGroupIds:VpcConfigurationDescription' :: VpcConfigurationDescription -> NonEmpty Text
securityGroupIds} -> NonEmpty Text
securityGroupIds) (\s :: VpcConfigurationDescription
s@VpcConfigurationDescription' {} NonEmpty Text
a -> VpcConfigurationDescription
s {$sel:securityGroupIds:VpcConfigurationDescription' :: NonEmpty Text
securityGroupIds = NonEmpty Text
a} :: VpcConfigurationDescription) ((NonEmpty Text -> f (NonEmpty Text))
-> VpcConfigurationDescription -> f VpcConfigurationDescription)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> VpcConfigurationDescription
-> f VpcConfigurationDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON VpcConfigurationDescription where
parseJSON :: Value -> Parser VpcConfigurationDescription
parseJSON =
String
-> (Object -> Parser VpcConfigurationDescription)
-> Value
-> Parser VpcConfigurationDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VpcConfigurationDescription"
( \Object
x ->
Text
-> Text
-> NonEmpty Text
-> NonEmpty Text
-> VpcConfigurationDescription
VpcConfigurationDescription'
(Text
-> Text
-> NonEmpty Text
-> NonEmpty Text
-> VpcConfigurationDescription)
-> Parser Text
-> Parser
(Text
-> NonEmpty Text -> NonEmpty Text -> VpcConfigurationDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VpcConfigurationId")
Parser
(Text
-> NonEmpty Text -> NonEmpty Text -> VpcConfigurationDescription)
-> Parser Text
-> Parser
(NonEmpty Text -> NonEmpty Text -> VpcConfigurationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VpcId")
Parser
(NonEmpty Text -> NonEmpty Text -> VpcConfigurationDescription)
-> Parser (NonEmpty Text)
-> Parser (NonEmpty Text -> VpcConfigurationDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SubnetIds")
Parser (NonEmpty Text -> VpcConfigurationDescription)
-> Parser (NonEmpty Text) -> Parser VpcConfigurationDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SecurityGroupIds")
)
instance Prelude.Hashable VpcConfigurationDescription
instance Prelude.NFData VpcConfigurationDescription