{-# 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.ConnectionInput where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.ConnectionPropertyKey
import Amazonka.Glue.Types.ConnectionType
import Amazonka.Glue.Types.PhysicalConnectionRequirements
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConnectionInput = ConnectionInput'
{
ConnectionInput -> Maybe [Text]
matchCriteria :: Prelude.Maybe [Prelude.Text],
ConnectionInput -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements :: Prelude.Maybe PhysicalConnectionRequirements,
ConnectionInput -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ConnectionInput -> Text
name :: Prelude.Text,
ConnectionInput -> ConnectionType
connectionType :: ConnectionType,
ConnectionInput -> HashMap ConnectionPropertyKey Text
connectionProperties :: Prelude.HashMap ConnectionPropertyKey Prelude.Text
}
deriving (ConnectionInput -> ConnectionInput -> Bool
(ConnectionInput -> ConnectionInput -> Bool)
-> (ConnectionInput -> ConnectionInput -> Bool)
-> Eq ConnectionInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectionInput -> ConnectionInput -> Bool
$c/= :: ConnectionInput -> ConnectionInput -> Bool
== :: ConnectionInput -> ConnectionInput -> Bool
$c== :: ConnectionInput -> ConnectionInput -> Bool
Prelude.Eq, ReadPrec [ConnectionInput]
ReadPrec ConnectionInput
Int -> ReadS ConnectionInput
ReadS [ConnectionInput]
(Int -> ReadS ConnectionInput)
-> ReadS [ConnectionInput]
-> ReadPrec ConnectionInput
-> ReadPrec [ConnectionInput]
-> Read ConnectionInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectionInput]
$creadListPrec :: ReadPrec [ConnectionInput]
readPrec :: ReadPrec ConnectionInput
$creadPrec :: ReadPrec ConnectionInput
readList :: ReadS [ConnectionInput]
$creadList :: ReadS [ConnectionInput]
readsPrec :: Int -> ReadS ConnectionInput
$creadsPrec :: Int -> ReadS ConnectionInput
Prelude.Read, Int -> ConnectionInput -> ShowS
[ConnectionInput] -> ShowS
ConnectionInput -> String
(Int -> ConnectionInput -> ShowS)
-> (ConnectionInput -> String)
-> ([ConnectionInput] -> ShowS)
-> Show ConnectionInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectionInput] -> ShowS
$cshowList :: [ConnectionInput] -> ShowS
show :: ConnectionInput -> String
$cshow :: ConnectionInput -> String
showsPrec :: Int -> ConnectionInput -> ShowS
$cshowsPrec :: Int -> ConnectionInput -> ShowS
Prelude.Show, (forall x. ConnectionInput -> Rep ConnectionInput x)
-> (forall x. Rep ConnectionInput x -> ConnectionInput)
-> Generic ConnectionInput
forall x. Rep ConnectionInput x -> ConnectionInput
forall x. ConnectionInput -> Rep ConnectionInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectionInput x -> ConnectionInput
$cfrom :: forall x. ConnectionInput -> Rep ConnectionInput x
Prelude.Generic)
newConnectionInput ::
Prelude.Text ->
ConnectionType ->
ConnectionInput
newConnectionInput :: Text -> ConnectionType -> ConnectionInput
newConnectionInput Text
pName_ ConnectionType
pConnectionType_ =
ConnectionInput' :: Maybe [Text]
-> Maybe PhysicalConnectionRequirements
-> Maybe Text
-> Text
-> ConnectionType
-> HashMap ConnectionPropertyKey Text
-> ConnectionInput
ConnectionInput'
{ $sel:matchCriteria:ConnectionInput' :: Maybe [Text]
matchCriteria = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:physicalConnectionRequirements:ConnectionInput' :: Maybe PhysicalConnectionRequirements
physicalConnectionRequirements = Maybe PhysicalConnectionRequirements
forall a. Maybe a
Prelude.Nothing,
$sel:description:ConnectionInput' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ConnectionInput' :: Text
name = Text
pName_,
$sel:connectionType:ConnectionInput' :: ConnectionType
connectionType = ConnectionType
pConnectionType_,
$sel:connectionProperties:ConnectionInput' :: HashMap ConnectionPropertyKey Text
connectionProperties = HashMap ConnectionPropertyKey Text
forall a. Monoid a => a
Prelude.mempty
}
connectionInput_matchCriteria :: Lens.Lens' ConnectionInput (Prelude.Maybe [Prelude.Text])
connectionInput_matchCriteria :: (Maybe [Text] -> f (Maybe [Text]))
-> ConnectionInput -> f ConnectionInput
connectionInput_matchCriteria = (ConnectionInput -> Maybe [Text])
-> (ConnectionInput -> Maybe [Text] -> ConnectionInput)
-> Lens
ConnectionInput ConnectionInput (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionInput' {Maybe [Text]
matchCriteria :: Maybe [Text]
$sel:matchCriteria:ConnectionInput' :: ConnectionInput -> Maybe [Text]
matchCriteria} -> Maybe [Text]
matchCriteria) (\s :: ConnectionInput
s@ConnectionInput' {} Maybe [Text]
a -> ConnectionInput
s {$sel:matchCriteria:ConnectionInput' :: Maybe [Text]
matchCriteria = Maybe [Text]
a} :: ConnectionInput) ((Maybe [Text] -> f (Maybe [Text]))
-> ConnectionInput -> f ConnectionInput)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ConnectionInput
-> f ConnectionInput
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
connectionInput_physicalConnectionRequirements :: Lens.Lens' ConnectionInput (Prelude.Maybe PhysicalConnectionRequirements)
connectionInput_physicalConnectionRequirements :: (Maybe PhysicalConnectionRequirements
-> f (Maybe PhysicalConnectionRequirements))
-> ConnectionInput -> f ConnectionInput
connectionInput_physicalConnectionRequirements = (ConnectionInput -> Maybe PhysicalConnectionRequirements)
-> (ConnectionInput
-> Maybe PhysicalConnectionRequirements -> ConnectionInput)
-> Lens
ConnectionInput
ConnectionInput
(Maybe PhysicalConnectionRequirements)
(Maybe PhysicalConnectionRequirements)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionInput' {Maybe PhysicalConnectionRequirements
physicalConnectionRequirements :: Maybe PhysicalConnectionRequirements
$sel:physicalConnectionRequirements:ConnectionInput' :: ConnectionInput -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements} -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements) (\s :: ConnectionInput
s@ConnectionInput' {} Maybe PhysicalConnectionRequirements
a -> ConnectionInput
s {$sel:physicalConnectionRequirements:ConnectionInput' :: Maybe PhysicalConnectionRequirements
physicalConnectionRequirements = Maybe PhysicalConnectionRequirements
a} :: ConnectionInput)
connectionInput_description :: Lens.Lens' ConnectionInput (Prelude.Maybe Prelude.Text)
connectionInput_description :: (Maybe Text -> f (Maybe Text))
-> ConnectionInput -> f ConnectionInput
connectionInput_description = (ConnectionInput -> Maybe Text)
-> (ConnectionInput -> Maybe Text -> ConnectionInput)
-> Lens ConnectionInput ConnectionInput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionInput' {Maybe Text
description :: Maybe Text
$sel:description:ConnectionInput' :: ConnectionInput -> Maybe Text
description} -> Maybe Text
description) (\s :: ConnectionInput
s@ConnectionInput' {} Maybe Text
a -> ConnectionInput
s {$sel:description:ConnectionInput' :: Maybe Text
description = Maybe Text
a} :: ConnectionInput)
connectionInput_name :: Lens.Lens' ConnectionInput Prelude.Text
connectionInput_name :: (Text -> f Text) -> ConnectionInput -> f ConnectionInput
connectionInput_name = (ConnectionInput -> Text)
-> (ConnectionInput -> Text -> ConnectionInput)
-> Lens ConnectionInput ConnectionInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionInput' {Text
name :: Text
$sel:name:ConnectionInput' :: ConnectionInput -> Text
name} -> Text
name) (\s :: ConnectionInput
s@ConnectionInput' {} Text
a -> ConnectionInput
s {$sel:name:ConnectionInput' :: Text
name = Text
a} :: ConnectionInput)
connectionInput_connectionType :: Lens.Lens' ConnectionInput ConnectionType
connectionInput_connectionType :: (ConnectionType -> f ConnectionType)
-> ConnectionInput -> f ConnectionInput
connectionInput_connectionType = (ConnectionInput -> ConnectionType)
-> (ConnectionInput -> ConnectionType -> ConnectionInput)
-> Lens
ConnectionInput ConnectionInput ConnectionType ConnectionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionInput' {ConnectionType
connectionType :: ConnectionType
$sel:connectionType:ConnectionInput' :: ConnectionInput -> ConnectionType
connectionType} -> ConnectionType
connectionType) (\s :: ConnectionInput
s@ConnectionInput' {} ConnectionType
a -> ConnectionInput
s {$sel:connectionType:ConnectionInput' :: ConnectionType
connectionType = ConnectionType
a} :: ConnectionInput)
connectionInput_connectionProperties :: Lens.Lens' ConnectionInput (Prelude.HashMap ConnectionPropertyKey Prelude.Text)
connectionInput_connectionProperties :: (HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text))
-> ConnectionInput -> f ConnectionInput
connectionInput_connectionProperties = (ConnectionInput -> HashMap ConnectionPropertyKey Text)
-> (ConnectionInput
-> HashMap ConnectionPropertyKey Text -> ConnectionInput)
-> Lens
ConnectionInput
ConnectionInput
(HashMap ConnectionPropertyKey Text)
(HashMap ConnectionPropertyKey Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectionInput' {HashMap ConnectionPropertyKey Text
connectionProperties :: HashMap ConnectionPropertyKey Text
$sel:connectionProperties:ConnectionInput' :: ConnectionInput -> HashMap ConnectionPropertyKey Text
connectionProperties} -> HashMap ConnectionPropertyKey Text
connectionProperties) (\s :: ConnectionInput
s@ConnectionInput' {} HashMap ConnectionPropertyKey Text
a -> ConnectionInput
s {$sel:connectionProperties:ConnectionInput' :: HashMap ConnectionPropertyKey Text
connectionProperties = HashMap ConnectionPropertyKey Text
a} :: ConnectionInput) ((HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text))
-> ConnectionInput -> f ConnectionInput)
-> ((HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text))
-> HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text))
-> (HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text))
-> ConnectionInput
-> f ConnectionInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text))
-> HashMap ConnectionPropertyKey Text
-> f (HashMap ConnectionPropertyKey Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable ConnectionInput
instance Prelude.NFData ConnectionInput
instance Core.ToJSON ConnectionInput where
toJSON :: ConnectionInput -> Value
toJSON ConnectionInput' {Maybe [Text]
Maybe Text
Maybe PhysicalConnectionRequirements
Text
HashMap ConnectionPropertyKey Text
ConnectionType
connectionProperties :: HashMap ConnectionPropertyKey Text
connectionType :: ConnectionType
name :: Text
description :: Maybe Text
physicalConnectionRequirements :: Maybe PhysicalConnectionRequirements
matchCriteria :: Maybe [Text]
$sel:connectionProperties:ConnectionInput' :: ConnectionInput -> HashMap ConnectionPropertyKey Text
$sel:connectionType:ConnectionInput' :: ConnectionInput -> ConnectionType
$sel:name:ConnectionInput' :: ConnectionInput -> Text
$sel:description:ConnectionInput' :: ConnectionInput -> Maybe Text
$sel:physicalConnectionRequirements:ConnectionInput' :: ConnectionInput -> Maybe PhysicalConnectionRequirements
$sel:matchCriteria:ConnectionInput' :: ConnectionInput -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MatchCriteria" 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]
matchCriteria,
(Text
"PhysicalConnectionRequirements" Text -> PhysicalConnectionRequirements -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PhysicalConnectionRequirements -> Pair)
-> Maybe PhysicalConnectionRequirements -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements,
(Text
"Description" 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
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ConnectionType" Text -> ConnectionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectionType
connectionType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ConnectionProperties"
Text -> HashMap ConnectionPropertyKey Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap ConnectionPropertyKey Text
connectionProperties
)
]
)