{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Glue.Types.ConnectionPropertyKey
import Amazonka.Glue.Types.ConnectionType
import Amazonka.Glue.Types.PhysicalConnectionRequirements
import qualified Amazonka.Prelude as Prelude
data ConnectionInput = ConnectionInput'
{
ConnectionInput -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ConnectionInput -> Maybe [Text]
matchCriteria :: Prelude.Maybe [Prelude.Text],
ConnectionInput -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements :: Prelude.Maybe PhysicalConnectionRequirements,
ConnectionInput -> Text
name :: Prelude.Text,
ConnectionInput -> ConnectionType
connectionType :: ConnectionType,
ConnectionInput -> HashMap ConnectionPropertyKey Text
connectionProperties :: Prelude.HashMap ConnectionPropertyKey Prelude.Text
}
deriving (ConnectionInput -> ConnectionInput -> Bool
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]
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
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. 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'
{ $sel:description:ConnectionInput' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:matchCriteria:ConnectionInput' :: Maybe [Text]
matchCriteria = forall a. Maybe a
Prelude.Nothing,
$sel:physicalConnectionRequirements:ConnectionInput' :: Maybe PhysicalConnectionRequirements
physicalConnectionRequirements = 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 = forall a. Monoid a => a
Prelude.mempty
}
connectionInput_description :: Lens.Lens' ConnectionInput (Prelude.Maybe Prelude.Text)
connectionInput_description :: Lens' ConnectionInput (Maybe Text)
connectionInput_description = 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_matchCriteria :: Lens.Lens' ConnectionInput (Prelude.Maybe [Prelude.Text])
connectionInput_matchCriteria :: Lens' ConnectionInput (Maybe [Text])
connectionInput_matchCriteria = 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) 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
connectionInput_physicalConnectionRequirements :: Lens.Lens' ConnectionInput (Prelude.Maybe PhysicalConnectionRequirements)
connectionInput_physicalConnectionRequirements :: Lens' ConnectionInput (Maybe PhysicalConnectionRequirements)
connectionInput_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_name :: Lens.Lens' ConnectionInput Prelude.Text
connectionInput_name :: Lens' ConnectionInput Text
connectionInput_name = 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 :: Lens' ConnectionInput ConnectionType
connectionInput_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 :: Lens' ConnectionInput (HashMap ConnectionPropertyKey Text)
connectionInput_connectionProperties = 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) 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 Prelude.Hashable ConnectionInput where
hashWithSalt :: Int -> ConnectionInput -> Int
hashWithSalt Int
_salt ConnectionInput' {Maybe [Text]
Maybe Text
Maybe PhysicalConnectionRequirements
Text
HashMap ConnectionPropertyKey Text
ConnectionType
connectionProperties :: HashMap ConnectionPropertyKey Text
connectionType :: ConnectionType
name :: Text
physicalConnectionRequirements :: Maybe PhysicalConnectionRequirements
matchCriteria :: Maybe [Text]
description :: Maybe Text
$sel:connectionProperties:ConnectionInput' :: ConnectionInput -> HashMap ConnectionPropertyKey Text
$sel:connectionType:ConnectionInput' :: ConnectionInput -> ConnectionType
$sel:name:ConnectionInput' :: ConnectionInput -> Text
$sel:physicalConnectionRequirements:ConnectionInput' :: ConnectionInput -> Maybe PhysicalConnectionRequirements
$sel:matchCriteria:ConnectionInput' :: ConnectionInput -> Maybe [Text]
$sel:description:ConnectionInput' :: ConnectionInput -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
matchCriteria
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PhysicalConnectionRequirements
physicalConnectionRequirements
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ConnectionType
connectionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap ConnectionPropertyKey Text
connectionProperties
instance Prelude.NFData ConnectionInput where
rnf :: ConnectionInput -> ()
rnf ConnectionInput' {Maybe [Text]
Maybe Text
Maybe PhysicalConnectionRequirements
Text
HashMap ConnectionPropertyKey Text
ConnectionType
connectionProperties :: HashMap ConnectionPropertyKey Text
connectionType :: ConnectionType
name :: Text
physicalConnectionRequirements :: Maybe PhysicalConnectionRequirements
matchCriteria :: Maybe [Text]
description :: Maybe Text
$sel:connectionProperties:ConnectionInput' :: ConnectionInput -> HashMap ConnectionPropertyKey Text
$sel:connectionType:ConnectionInput' :: ConnectionInput -> ConnectionType
$sel:name:ConnectionInput' :: ConnectionInput -> Text
$sel:physicalConnectionRequirements:ConnectionInput' :: ConnectionInput -> Maybe PhysicalConnectionRequirements
$sel:matchCriteria:ConnectionInput' :: ConnectionInput -> Maybe [Text]
$sel:description:ConnectionInput' :: ConnectionInput -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
matchCriteria
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PhysicalConnectionRequirements
physicalConnectionRequirements
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ConnectionType
connectionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap ConnectionPropertyKey Text
connectionProperties
instance Data.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
physicalConnectionRequirements :: Maybe PhysicalConnectionRequirements
matchCriteria :: Maybe [Text]
description :: Maybe Text
$sel:connectionProperties:ConnectionInput' :: ConnectionInput -> HashMap ConnectionPropertyKey Text
$sel:connectionType:ConnectionInput' :: ConnectionInput -> ConnectionType
$sel:name:ConnectionInput' :: ConnectionInput -> Text
$sel:physicalConnectionRequirements:ConnectionInput' :: ConnectionInput -> Maybe PhysicalConnectionRequirements
$sel:matchCriteria:ConnectionInput' :: ConnectionInput -> Maybe [Text]
$sel:description:ConnectionInput' :: ConnectionInput -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Description" 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 Text
description,
(Key
"MatchCriteria" 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 [Text]
matchCriteria,
(Key
"PhysicalConnectionRequirements" 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 PhysicalConnectionRequirements
physicalConnectionRequirements,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just
(Key
"ConnectionType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ConnectionType
connectionType),
forall a. a -> Maybe a
Prelude.Just
( Key
"ConnectionProperties"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap ConnectionPropertyKey Text
connectionProperties
)
]
)