{-# 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.Lens as Lens
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
(NeoVpcConfig -> NeoVpcConfig -> Bool)
-> (NeoVpcConfig -> NeoVpcConfig -> Bool) -> Eq NeoVpcConfig
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]
(Int -> ReadS NeoVpcConfig)
-> ReadS [NeoVpcConfig]
-> ReadPrec NeoVpcConfig
-> ReadPrec [NeoVpcConfig]
-> Read 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
(Int -> NeoVpcConfig -> ShowS)
-> (NeoVpcConfig -> String)
-> ([NeoVpcConfig] -> ShowS)
-> Show NeoVpcConfig
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. NeoVpcConfig -> Rep NeoVpcConfig x)
-> (forall x. Rep NeoVpcConfig x -> NeoVpcConfig)
-> Generic NeoVpcConfig
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' :: NonEmpty Text -> NonEmpty Text -> NeoVpcConfig
NeoVpcConfig'
{ $sel:securityGroupIds:NeoVpcConfig' :: 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_,
$sel:subnets:NeoVpcConfig' :: NonEmpty Text
subnets = 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
pSubnets_
}
neoVpcConfig_securityGroupIds :: Lens.Lens' NeoVpcConfig (Prelude.NonEmpty Prelude.Text)
neoVpcConfig_securityGroupIds :: (NonEmpty Text -> f (NonEmpty Text))
-> NeoVpcConfig -> f NeoVpcConfig
neoVpcConfig_securityGroupIds = (NeoVpcConfig -> NonEmpty Text)
-> (NeoVpcConfig -> NonEmpty Text -> NeoVpcConfig)
-> Lens NeoVpcConfig NeoVpcConfig (NonEmpty Text) (NonEmpty Text)
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) ((NonEmpty Text -> f (NonEmpty Text))
-> NeoVpcConfig -> f NeoVpcConfig)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> NeoVpcConfig
-> f NeoVpcConfig
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
neoVpcConfig_subnets :: Lens.Lens' NeoVpcConfig (Prelude.NonEmpty Prelude.Text)
neoVpcConfig_subnets :: (NonEmpty Text -> f (NonEmpty Text))
-> NeoVpcConfig -> f NeoVpcConfig
neoVpcConfig_subnets = (NeoVpcConfig -> NonEmpty Text)
-> (NeoVpcConfig -> NonEmpty Text -> NeoVpcConfig)
-> Lens NeoVpcConfig NeoVpcConfig (NonEmpty Text) (NonEmpty Text)
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) ((NonEmpty Text -> f (NonEmpty Text))
-> NeoVpcConfig -> f NeoVpcConfig)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> NeoVpcConfig
-> f NeoVpcConfig
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 NeoVpcConfig where
parseJSON :: Value -> Parser NeoVpcConfig
parseJSON =
String
-> (Object -> Parser NeoVpcConfig) -> Value -> Parser NeoVpcConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NeoVpcConfig"
( \Object
x ->
NonEmpty Text -> NonEmpty Text -> NeoVpcConfig
NeoVpcConfig'
(NonEmpty Text -> NonEmpty Text -> NeoVpcConfig)
-> Parser (NonEmpty Text) -> Parser (NonEmpty Text -> NeoVpcConfig)
forall (f :: * -> *) a b. Functor 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")
Parser (NonEmpty Text -> NeoVpcConfig)
-> Parser (NonEmpty Text) -> Parser NeoVpcConfig
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
"Subnets")
)
instance Prelude.Hashable NeoVpcConfig
instance Prelude.NFData NeoVpcConfig
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SecurityGroupIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
securityGroupIds),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Subnets" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
subnets)
]
)