{-# 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.Scheduler.Types.AwsVpcConfiguration 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.Scheduler.Types.AssignPublicIp
data AwsVpcConfiguration = AwsVpcConfiguration'
{
AwsVpcConfiguration -> Maybe AssignPublicIp
assignPublicIp :: Prelude.Maybe AssignPublicIp,
AwsVpcConfiguration -> Maybe (NonEmpty Text)
securityGroups :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
AwsVpcConfiguration -> NonEmpty Text
subnets :: Prelude.NonEmpty Prelude.Text
}
deriving (AwsVpcConfiguration -> AwsVpcConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsVpcConfiguration -> AwsVpcConfiguration -> Bool
$c/= :: AwsVpcConfiguration -> AwsVpcConfiguration -> Bool
== :: AwsVpcConfiguration -> AwsVpcConfiguration -> Bool
$c== :: AwsVpcConfiguration -> AwsVpcConfiguration -> Bool
Prelude.Eq, ReadPrec [AwsVpcConfiguration]
ReadPrec AwsVpcConfiguration
Int -> ReadS AwsVpcConfiguration
ReadS [AwsVpcConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsVpcConfiguration]
$creadListPrec :: ReadPrec [AwsVpcConfiguration]
readPrec :: ReadPrec AwsVpcConfiguration
$creadPrec :: ReadPrec AwsVpcConfiguration
readList :: ReadS [AwsVpcConfiguration]
$creadList :: ReadS [AwsVpcConfiguration]
readsPrec :: Int -> ReadS AwsVpcConfiguration
$creadsPrec :: Int -> ReadS AwsVpcConfiguration
Prelude.Read, Int -> AwsVpcConfiguration -> ShowS
[AwsVpcConfiguration] -> ShowS
AwsVpcConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsVpcConfiguration] -> ShowS
$cshowList :: [AwsVpcConfiguration] -> ShowS
show :: AwsVpcConfiguration -> String
$cshow :: AwsVpcConfiguration -> String
showsPrec :: Int -> AwsVpcConfiguration -> ShowS
$cshowsPrec :: Int -> AwsVpcConfiguration -> ShowS
Prelude.Show, forall x. Rep AwsVpcConfiguration x -> AwsVpcConfiguration
forall x. AwsVpcConfiguration -> Rep AwsVpcConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsVpcConfiguration x -> AwsVpcConfiguration
$cfrom :: forall x. AwsVpcConfiguration -> Rep AwsVpcConfiguration x
Prelude.Generic)
newAwsVpcConfiguration ::
Prelude.NonEmpty Prelude.Text ->
AwsVpcConfiguration
newAwsVpcConfiguration :: NonEmpty Text -> AwsVpcConfiguration
newAwsVpcConfiguration NonEmpty Text
pSubnets_ =
AwsVpcConfiguration'
{ $sel:assignPublicIp:AwsVpcConfiguration' :: Maybe AssignPublicIp
assignPublicIp =
forall a. Maybe a
Prelude.Nothing,
$sel:securityGroups:AwsVpcConfiguration' :: Maybe (NonEmpty Text)
securityGroups = forall a. Maybe a
Prelude.Nothing,
$sel:subnets:AwsVpcConfiguration' :: NonEmpty Text
subnets = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSubnets_
}
awsVpcConfiguration_assignPublicIp :: Lens.Lens' AwsVpcConfiguration (Prelude.Maybe AssignPublicIp)
awsVpcConfiguration_assignPublicIp :: Lens' AwsVpcConfiguration (Maybe AssignPublicIp)
awsVpcConfiguration_assignPublicIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsVpcConfiguration' {Maybe AssignPublicIp
assignPublicIp :: Maybe AssignPublicIp
$sel:assignPublicIp:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe AssignPublicIp
assignPublicIp} -> Maybe AssignPublicIp
assignPublicIp) (\s :: AwsVpcConfiguration
s@AwsVpcConfiguration' {} Maybe AssignPublicIp
a -> AwsVpcConfiguration
s {$sel:assignPublicIp:AwsVpcConfiguration' :: Maybe AssignPublicIp
assignPublicIp = Maybe AssignPublicIp
a} :: AwsVpcConfiguration)
awsVpcConfiguration_securityGroups :: Lens.Lens' AwsVpcConfiguration (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
awsVpcConfiguration_securityGroups :: Lens' AwsVpcConfiguration (Maybe (NonEmpty Text))
awsVpcConfiguration_securityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsVpcConfiguration' {Maybe (NonEmpty Text)
securityGroups :: Maybe (NonEmpty Text)
$sel:securityGroups:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe (NonEmpty Text)
securityGroups} -> Maybe (NonEmpty Text)
securityGroups) (\s :: AwsVpcConfiguration
s@AwsVpcConfiguration' {} Maybe (NonEmpty Text)
a -> AwsVpcConfiguration
s {$sel:securityGroups:AwsVpcConfiguration' :: Maybe (NonEmpty Text)
securityGroups = Maybe (NonEmpty Text)
a} :: AwsVpcConfiguration) 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
awsVpcConfiguration_subnets :: Lens.Lens' AwsVpcConfiguration (Prelude.NonEmpty Prelude.Text)
awsVpcConfiguration_subnets :: Lens' AwsVpcConfiguration (NonEmpty Text)
awsVpcConfiguration_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsVpcConfiguration' {NonEmpty Text
subnets :: NonEmpty Text
$sel:subnets:AwsVpcConfiguration' :: AwsVpcConfiguration -> NonEmpty Text
subnets} -> NonEmpty Text
subnets) (\s :: AwsVpcConfiguration
s@AwsVpcConfiguration' {} NonEmpty Text
a -> AwsVpcConfiguration
s {$sel:subnets:AwsVpcConfiguration' :: NonEmpty Text
subnets = NonEmpty Text
a} :: AwsVpcConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON AwsVpcConfiguration where
parseJSON :: Value -> Parser AwsVpcConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AwsVpcConfiguration"
( \Object
x ->
Maybe AssignPublicIp
-> Maybe (NonEmpty Text) -> NonEmpty Text -> AwsVpcConfiguration
AwsVpcConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AssignPublicIp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecurityGroups")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Subnets")
)
instance Prelude.Hashable AwsVpcConfiguration where
hashWithSalt :: Int -> AwsVpcConfiguration -> Int
hashWithSalt Int
_salt AwsVpcConfiguration' {Maybe (NonEmpty Text)
Maybe AssignPublicIp
NonEmpty Text
subnets :: NonEmpty Text
securityGroups :: Maybe (NonEmpty Text)
assignPublicIp :: Maybe AssignPublicIp
$sel:subnets:AwsVpcConfiguration' :: AwsVpcConfiguration -> NonEmpty Text
$sel:securityGroups:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe (NonEmpty Text)
$sel:assignPublicIp:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe AssignPublicIp
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssignPublicIp
assignPublicIp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
securityGroups
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
subnets
instance Prelude.NFData AwsVpcConfiguration where
rnf :: AwsVpcConfiguration -> ()
rnf AwsVpcConfiguration' {Maybe (NonEmpty Text)
Maybe AssignPublicIp
NonEmpty Text
subnets :: NonEmpty Text
securityGroups :: Maybe (NonEmpty Text)
assignPublicIp :: Maybe AssignPublicIp
$sel:subnets:AwsVpcConfiguration' :: AwsVpcConfiguration -> NonEmpty Text
$sel:securityGroups:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe (NonEmpty Text)
$sel:assignPublicIp:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe AssignPublicIp
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AssignPublicIp
assignPublicIp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
securityGroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
subnets
instance Data.ToJSON AwsVpcConfiguration where
toJSON :: AwsVpcConfiguration -> Value
toJSON AwsVpcConfiguration' {Maybe (NonEmpty Text)
Maybe AssignPublicIp
NonEmpty Text
subnets :: NonEmpty Text
securityGroups :: Maybe (NonEmpty Text)
assignPublicIp :: Maybe AssignPublicIp
$sel:subnets:AwsVpcConfiguration' :: AwsVpcConfiguration -> NonEmpty Text
$sel:securityGroups:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe (NonEmpty Text)
$sel:assignPublicIp:AwsVpcConfiguration' :: AwsVpcConfiguration -> Maybe AssignPublicIp
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AssignPublicIp" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssignPublicIp
assignPublicIp,
(Key
"SecurityGroups" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
securityGroups,
forall a. a -> Maybe a
Prelude.Just (Key
"Subnets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
subnets)
]
)