{-# 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.SageMaker.Types.NeoVpcConfig 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
data NeoVpcConfig = NeoVpcConfig'
{
NeoVpcConfig -> NonEmpty Text
securityGroupIds :: Prelude.NonEmpty Prelude.Text,
NeoVpcConfig -> NonEmpty Text
subnets :: Prelude.NonEmpty Prelude.Text
}
deriving (NeoVpcConfig -> NeoVpcConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NeoVpcConfig -> NeoVpcConfig -> Bool
$c/= :: NeoVpcConfig -> NeoVpcConfig -> Bool
== :: NeoVpcConfig -> NeoVpcConfig -> Bool
$c== :: NeoVpcConfig -> NeoVpcConfig -> Bool
Prelude.Eq, ReadPrec [NeoVpcConfig]
ReadPrec NeoVpcConfig
Int -> ReadS NeoVpcConfig
ReadS [NeoVpcConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NeoVpcConfig]
$creadListPrec :: ReadPrec [NeoVpcConfig]
readPrec :: ReadPrec NeoVpcConfig
$creadPrec :: ReadPrec NeoVpcConfig
readList :: ReadS [NeoVpcConfig]
$creadList :: ReadS [NeoVpcConfig]
readsPrec :: Int -> ReadS NeoVpcConfig
$creadsPrec :: Int -> ReadS NeoVpcConfig
Prelude.Read, Int -> NeoVpcConfig -> ShowS
[NeoVpcConfig] -> ShowS
NeoVpcConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NeoVpcConfig] -> ShowS
$cshowList :: [NeoVpcConfig] -> ShowS
show :: NeoVpcConfig -> String
$cshow :: NeoVpcConfig -> String
showsPrec :: Int -> NeoVpcConfig -> ShowS
$cshowsPrec :: Int -> NeoVpcConfig -> ShowS
Prelude.Show, forall x. Rep NeoVpcConfig x -> NeoVpcConfig
forall x. NeoVpcConfig -> Rep NeoVpcConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NeoVpcConfig x -> NeoVpcConfig
$cfrom :: forall x. NeoVpcConfig -> Rep NeoVpcConfig x
Prelude.Generic)
newNeoVpcConfig ::
Prelude.NonEmpty Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
NeoVpcConfig
newNeoVpcConfig :: NonEmpty Text -> NonEmpty Text -> NeoVpcConfig
newNeoVpcConfig NonEmpty Text
pSecurityGroupIds_ NonEmpty Text
pSubnets_ =
NeoVpcConfig'
{ $sel:securityGroupIds:NeoVpcConfig' :: NonEmpty Text
securityGroupIds =
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
pSecurityGroupIds_,
$sel:subnets:NeoVpcConfig' :: 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_
}
neoVpcConfig_securityGroupIds :: Lens.Lens' NeoVpcConfig (Prelude.NonEmpty Prelude.Text)
neoVpcConfig_securityGroupIds :: Lens' NeoVpcConfig (NonEmpty Text)
neoVpcConfig_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NeoVpcConfig' {NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:securityGroupIds:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
securityGroupIds} -> NonEmpty Text
securityGroupIds) (\s :: NeoVpcConfig
s@NeoVpcConfig' {} NonEmpty Text
a -> NeoVpcConfig
s {$sel:securityGroupIds:NeoVpcConfig' :: NonEmpty Text
securityGroupIds = NonEmpty Text
a} :: NeoVpcConfig) 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
neoVpcConfig_subnets :: Lens.Lens' NeoVpcConfig (Prelude.NonEmpty Prelude.Text)
neoVpcConfig_subnets :: Lens' NeoVpcConfig (NonEmpty Text)
neoVpcConfig_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NeoVpcConfig' {NonEmpty Text
subnets :: NonEmpty Text
$sel:subnets:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
subnets} -> NonEmpty Text
subnets) (\s :: NeoVpcConfig
s@NeoVpcConfig' {} NonEmpty Text
a -> NeoVpcConfig
s {$sel:subnets:NeoVpcConfig' :: NonEmpty Text
subnets = NonEmpty Text
a} :: NeoVpcConfig) 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 NeoVpcConfig where
parseJSON :: Value -> Parser NeoVpcConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NeoVpcConfig"
( \Object
x ->
NonEmpty Text -> NonEmpty Text -> NeoVpcConfig
NeoVpcConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SecurityGroupIds")
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 NeoVpcConfig where
hashWithSalt :: Int -> NeoVpcConfig -> Int
hashWithSalt Int
_salt NeoVpcConfig' {NonEmpty Text
subnets :: NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:subnets:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
$sel:securityGroupIds:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
securityGroupIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
subnets
instance Prelude.NFData NeoVpcConfig where
rnf :: NeoVpcConfig -> ()
rnf NeoVpcConfig' {NonEmpty Text
subnets :: NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:subnets:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
$sel:securityGroupIds:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
securityGroupIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
subnets
instance Data.ToJSON NeoVpcConfig where
toJSON :: NeoVpcConfig -> Value
toJSON NeoVpcConfig' {NonEmpty Text
subnets :: NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:subnets:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
$sel:securityGroupIds:NeoVpcConfig' :: NeoVpcConfig -> NonEmpty Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"SecurityGroupIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
securityGroupIds),
forall a. a -> Maybe a
Prelude.Just (Key
"Subnets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
subnets)
]
)