{-# 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.Glue.Types.PhysicalConnectionRequirements where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PhysicalConnectionRequirements = PhysicalConnectionRequirements'
{
PhysicalConnectionRequirements -> Maybe [Text]
securityGroupIdList :: Prelude.Maybe [Prelude.Text],
PhysicalConnectionRequirements -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
PhysicalConnectionRequirements -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text
}
deriving (PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool
(PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool)
-> (PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool)
-> Eq PhysicalConnectionRequirements
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool
$c/= :: PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool
== :: PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool
$c== :: PhysicalConnectionRequirements
-> PhysicalConnectionRequirements -> Bool
Prelude.Eq, ReadPrec [PhysicalConnectionRequirements]
ReadPrec PhysicalConnectionRequirements
Int -> ReadS PhysicalConnectionRequirements
ReadS [PhysicalConnectionRequirements]
(Int -> ReadS PhysicalConnectionRequirements)
-> ReadS [PhysicalConnectionRequirements]
-> ReadPrec PhysicalConnectionRequirements
-> ReadPrec [PhysicalConnectionRequirements]
-> Read PhysicalConnectionRequirements
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhysicalConnectionRequirements]
$creadListPrec :: ReadPrec [PhysicalConnectionRequirements]
readPrec :: ReadPrec PhysicalConnectionRequirements
$creadPrec :: ReadPrec PhysicalConnectionRequirements
readList :: ReadS [PhysicalConnectionRequirements]
$creadList :: ReadS [PhysicalConnectionRequirements]
readsPrec :: Int -> ReadS PhysicalConnectionRequirements
$creadsPrec :: Int -> ReadS PhysicalConnectionRequirements
Prelude.Read, Int -> PhysicalConnectionRequirements -> ShowS
[PhysicalConnectionRequirements] -> ShowS
PhysicalConnectionRequirements -> String
(Int -> PhysicalConnectionRequirements -> ShowS)
-> (PhysicalConnectionRequirements -> String)
-> ([PhysicalConnectionRequirements] -> ShowS)
-> Show PhysicalConnectionRequirements
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhysicalConnectionRequirements] -> ShowS
$cshowList :: [PhysicalConnectionRequirements] -> ShowS
show :: PhysicalConnectionRequirements -> String
$cshow :: PhysicalConnectionRequirements -> String
showsPrec :: Int -> PhysicalConnectionRequirements -> ShowS
$cshowsPrec :: Int -> PhysicalConnectionRequirements -> ShowS
Prelude.Show, (forall x.
PhysicalConnectionRequirements
-> Rep PhysicalConnectionRequirements x)
-> (forall x.
Rep PhysicalConnectionRequirements x
-> PhysicalConnectionRequirements)
-> Generic PhysicalConnectionRequirements
forall x.
Rep PhysicalConnectionRequirements x
-> PhysicalConnectionRequirements
forall x.
PhysicalConnectionRequirements
-> Rep PhysicalConnectionRequirements x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PhysicalConnectionRequirements x
-> PhysicalConnectionRequirements
$cfrom :: forall x.
PhysicalConnectionRequirements
-> Rep PhysicalConnectionRequirements x
Prelude.Generic)
newPhysicalConnectionRequirements ::
PhysicalConnectionRequirements
newPhysicalConnectionRequirements :: PhysicalConnectionRequirements
newPhysicalConnectionRequirements =
PhysicalConnectionRequirements' :: Maybe [Text]
-> Maybe Text -> Maybe Text -> PhysicalConnectionRequirements
PhysicalConnectionRequirements'
{ $sel:securityGroupIdList:PhysicalConnectionRequirements' :: Maybe [Text]
securityGroupIdList =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:subnetId:PhysicalConnectionRequirements' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:PhysicalConnectionRequirements' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
physicalConnectionRequirements_securityGroupIdList :: Lens.Lens' PhysicalConnectionRequirements (Prelude.Maybe [Prelude.Text])
physicalConnectionRequirements_securityGroupIdList :: (Maybe [Text] -> f (Maybe [Text]))
-> PhysicalConnectionRequirements
-> f PhysicalConnectionRequirements
physicalConnectionRequirements_securityGroupIdList = (PhysicalConnectionRequirements -> Maybe [Text])
-> (PhysicalConnectionRequirements
-> Maybe [Text] -> PhysicalConnectionRequirements)
-> Lens
PhysicalConnectionRequirements
PhysicalConnectionRequirements
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalConnectionRequirements' {Maybe [Text]
securityGroupIdList :: Maybe [Text]
$sel:securityGroupIdList:PhysicalConnectionRequirements' :: PhysicalConnectionRequirements -> Maybe [Text]
securityGroupIdList} -> Maybe [Text]
securityGroupIdList) (\s :: PhysicalConnectionRequirements
s@PhysicalConnectionRequirements' {} Maybe [Text]
a -> PhysicalConnectionRequirements
s {$sel:securityGroupIdList:PhysicalConnectionRequirements' :: Maybe [Text]
securityGroupIdList = Maybe [Text]
a} :: PhysicalConnectionRequirements) ((Maybe [Text] -> f (Maybe [Text]))
-> PhysicalConnectionRequirements
-> f PhysicalConnectionRequirements)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PhysicalConnectionRequirements
-> f PhysicalConnectionRequirements
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
physicalConnectionRequirements_subnetId :: Lens.Lens' PhysicalConnectionRequirements (Prelude.Maybe Prelude.Text)
physicalConnectionRequirements_subnetId :: (Maybe Text -> f (Maybe Text))
-> PhysicalConnectionRequirements
-> f PhysicalConnectionRequirements
physicalConnectionRequirements_subnetId = (PhysicalConnectionRequirements -> Maybe Text)
-> (PhysicalConnectionRequirements
-> Maybe Text -> PhysicalConnectionRequirements)
-> Lens
PhysicalConnectionRequirements
PhysicalConnectionRequirements
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalConnectionRequirements' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:PhysicalConnectionRequirements' :: PhysicalConnectionRequirements -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: PhysicalConnectionRequirements
s@PhysicalConnectionRequirements' {} Maybe Text
a -> PhysicalConnectionRequirements
s {$sel:subnetId:PhysicalConnectionRequirements' :: Maybe Text
subnetId = Maybe Text
a} :: PhysicalConnectionRequirements)
physicalConnectionRequirements_availabilityZone :: Lens.Lens' PhysicalConnectionRequirements (Prelude.Maybe Prelude.Text)
physicalConnectionRequirements_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> PhysicalConnectionRequirements
-> f PhysicalConnectionRequirements
physicalConnectionRequirements_availabilityZone = (PhysicalConnectionRequirements -> Maybe Text)
-> (PhysicalConnectionRequirements
-> Maybe Text -> PhysicalConnectionRequirements)
-> Lens
PhysicalConnectionRequirements
PhysicalConnectionRequirements
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalConnectionRequirements' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:PhysicalConnectionRequirements' :: PhysicalConnectionRequirements -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: PhysicalConnectionRequirements
s@PhysicalConnectionRequirements' {} Maybe Text
a -> PhysicalConnectionRequirements
s {$sel:availabilityZone:PhysicalConnectionRequirements' :: Maybe Text
availabilityZone = Maybe Text
a} :: PhysicalConnectionRequirements)
instance Core.FromJSON PhysicalConnectionRequirements where
parseJSON :: Value -> Parser PhysicalConnectionRequirements
parseJSON =
String
-> (Object -> Parser PhysicalConnectionRequirements)
-> Value
-> Parser PhysicalConnectionRequirements
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PhysicalConnectionRequirements"
( \Object
x ->
Maybe [Text]
-> Maybe Text -> Maybe Text -> PhysicalConnectionRequirements
PhysicalConnectionRequirements'
(Maybe [Text]
-> Maybe Text -> Maybe Text -> PhysicalConnectionRequirements)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text -> Maybe Text -> PhysicalConnectionRequirements)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityGroupIdList"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> Maybe Text -> PhysicalConnectionRequirements)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PhysicalConnectionRequirements)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetId")
Parser (Maybe Text -> PhysicalConnectionRequirements)
-> Parser (Maybe Text) -> Parser PhysicalConnectionRequirements
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AvailabilityZone")
)
instance
Prelude.Hashable
PhysicalConnectionRequirements
instance
Prelude.NFData
PhysicalConnectionRequirements
instance Core.ToJSON PhysicalConnectionRequirements where
toJSON :: PhysicalConnectionRequirements -> Value
toJSON PhysicalConnectionRequirements' {Maybe [Text]
Maybe Text
availabilityZone :: Maybe Text
subnetId :: Maybe Text
securityGroupIdList :: Maybe [Text]
$sel:availabilityZone:PhysicalConnectionRequirements' :: PhysicalConnectionRequirements -> Maybe Text
$sel:subnetId:PhysicalConnectionRequirements' :: PhysicalConnectionRequirements -> Maybe Text
$sel:securityGroupIdList:PhysicalConnectionRequirements' :: PhysicalConnectionRequirements -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SecurityGroupIdList" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIdList,
(Text
"SubnetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subnetId,
(Text
"AvailabilityZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
availabilityZone
]
)