{-# 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.ServiceCatalog.Types.SourceConnection 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
import Amazonka.ServiceCatalog.Types.SourceConnectionParameters
import Amazonka.ServiceCatalog.Types.SourceType
data SourceConnection = SourceConnection'
{
SourceConnection -> Maybe SourceType
type' :: Prelude.Maybe SourceType,
SourceConnection -> SourceConnectionParameters
connectionParameters :: SourceConnectionParameters
}
deriving (SourceConnection -> SourceConnection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceConnection -> SourceConnection -> Bool
$c/= :: SourceConnection -> SourceConnection -> Bool
== :: SourceConnection -> SourceConnection -> Bool
$c== :: SourceConnection -> SourceConnection -> Bool
Prelude.Eq, ReadPrec [SourceConnection]
ReadPrec SourceConnection
Int -> ReadS SourceConnection
ReadS [SourceConnection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceConnection]
$creadListPrec :: ReadPrec [SourceConnection]
readPrec :: ReadPrec SourceConnection
$creadPrec :: ReadPrec SourceConnection
readList :: ReadS [SourceConnection]
$creadList :: ReadS [SourceConnection]
readsPrec :: Int -> ReadS SourceConnection
$creadsPrec :: Int -> ReadS SourceConnection
Prelude.Read, Int -> SourceConnection -> ShowS
[SourceConnection] -> ShowS
SourceConnection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceConnection] -> ShowS
$cshowList :: [SourceConnection] -> ShowS
show :: SourceConnection -> String
$cshow :: SourceConnection -> String
showsPrec :: Int -> SourceConnection -> ShowS
$cshowsPrec :: Int -> SourceConnection -> ShowS
Prelude.Show, forall x. Rep SourceConnection x -> SourceConnection
forall x. SourceConnection -> Rep SourceConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceConnection x -> SourceConnection
$cfrom :: forall x. SourceConnection -> Rep SourceConnection x
Prelude.Generic)
newSourceConnection ::
SourceConnectionParameters ->
SourceConnection
newSourceConnection :: SourceConnectionParameters -> SourceConnection
newSourceConnection SourceConnectionParameters
pConnectionParameters_ =
SourceConnection'
{ $sel:type':SourceConnection' :: Maybe SourceType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:connectionParameters:SourceConnection' :: SourceConnectionParameters
connectionParameters = SourceConnectionParameters
pConnectionParameters_
}
sourceConnection_type :: Lens.Lens' SourceConnection (Prelude.Maybe SourceType)
sourceConnection_type :: Lens' SourceConnection (Maybe SourceType)
sourceConnection_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnection' {Maybe SourceType
type' :: Maybe SourceType
$sel:type':SourceConnection' :: SourceConnection -> Maybe SourceType
type'} -> Maybe SourceType
type') (\s :: SourceConnection
s@SourceConnection' {} Maybe SourceType
a -> SourceConnection
s {$sel:type':SourceConnection' :: Maybe SourceType
type' = Maybe SourceType
a} :: SourceConnection)
sourceConnection_connectionParameters :: Lens.Lens' SourceConnection SourceConnectionParameters
sourceConnection_connectionParameters :: Lens' SourceConnection SourceConnectionParameters
sourceConnection_connectionParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnection' {SourceConnectionParameters
connectionParameters :: SourceConnectionParameters
$sel:connectionParameters:SourceConnection' :: SourceConnection -> SourceConnectionParameters
connectionParameters} -> SourceConnectionParameters
connectionParameters) (\s :: SourceConnection
s@SourceConnection' {} SourceConnectionParameters
a -> SourceConnection
s {$sel:connectionParameters:SourceConnection' :: SourceConnectionParameters
connectionParameters = SourceConnectionParameters
a} :: SourceConnection)
instance Prelude.Hashable SourceConnection where
hashWithSalt :: Int -> SourceConnection -> Int
hashWithSalt Int
_salt SourceConnection' {Maybe SourceType
SourceConnectionParameters
connectionParameters :: SourceConnectionParameters
type' :: Maybe SourceType
$sel:connectionParameters:SourceConnection' :: SourceConnection -> SourceConnectionParameters
$sel:type':SourceConnection' :: SourceConnection -> Maybe SourceType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SourceConnectionParameters
connectionParameters
instance Prelude.NFData SourceConnection where
rnf :: SourceConnection -> ()
rnf SourceConnection' {Maybe SourceType
SourceConnectionParameters
connectionParameters :: SourceConnectionParameters
type' :: Maybe SourceType
$sel:connectionParameters:SourceConnection' :: SourceConnection -> SourceConnectionParameters
$sel:type':SourceConnection' :: SourceConnection -> Maybe SourceType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SourceConnectionParameters
connectionParameters
instance Data.ToJSON SourceConnection where
toJSON :: SourceConnection -> Value
toJSON SourceConnection' {Maybe SourceType
SourceConnectionParameters
connectionParameters :: SourceConnectionParameters
type' :: Maybe SourceType
$sel:connectionParameters:SourceConnection' :: SourceConnection -> SourceConnectionParameters
$sel:type':SourceConnection' :: SourceConnection -> Maybe SourceType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Type" 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 SourceType
type',
forall a. a -> Maybe a
Prelude.Just
( Key
"ConnectionParameters"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SourceConnectionParameters
connectionParameters
)
]
)