{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.KafkaConnect.CreateConnector
(
CreateConnector (..),
newCreateConnector,
createConnector_logDelivery,
createConnector_workerConfiguration,
createConnector_connectorDescription,
createConnector_capacity,
createConnector_connectorConfiguration,
createConnector_connectorName,
createConnector_kafkaCluster,
createConnector_kafkaClusterClientAuthentication,
createConnector_kafkaClusterEncryptionInTransit,
createConnector_kafkaConnectVersion,
createConnector_plugins,
createConnector_serviceExecutionRoleArn,
CreateConnectorResponse (..),
newCreateConnectorResponse,
createConnectorResponse_connectorArn,
createConnectorResponse_connectorName,
createConnectorResponse_connectorState,
createConnectorResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KafkaConnect.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateConnector = CreateConnector'
{
CreateConnector -> Maybe LogDelivery
logDelivery :: Prelude.Maybe LogDelivery,
CreateConnector -> Maybe WorkerConfiguration
workerConfiguration :: Prelude.Maybe WorkerConfiguration,
CreateConnector -> Maybe Text
connectorDescription :: Prelude.Maybe Prelude.Text,
CreateConnector -> Capacity
capacity :: Capacity,
CreateConnector -> HashMap Text Text
connectorConfiguration :: Prelude.HashMap Prelude.Text Prelude.Text,
CreateConnector -> Text
connectorName :: Prelude.Text,
CreateConnector -> KafkaCluster
kafkaCluster :: KafkaCluster,
CreateConnector -> KafkaClusterClientAuthentication
kafkaClusterClientAuthentication :: KafkaClusterClientAuthentication,
CreateConnector -> KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit :: KafkaClusterEncryptionInTransit,
CreateConnector -> Text
kafkaConnectVersion :: Prelude.Text,
CreateConnector -> [Plugin]
plugins :: [Plugin],
CreateConnector -> Text
serviceExecutionRoleArn :: Prelude.Text
}
deriving (CreateConnector -> CreateConnector -> Bool
(CreateConnector -> CreateConnector -> Bool)
-> (CreateConnector -> CreateConnector -> Bool)
-> Eq CreateConnector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnector -> CreateConnector -> Bool
$c/= :: CreateConnector -> CreateConnector -> Bool
== :: CreateConnector -> CreateConnector -> Bool
$c== :: CreateConnector -> CreateConnector -> Bool
Prelude.Eq, ReadPrec [CreateConnector]
ReadPrec CreateConnector
Int -> ReadS CreateConnector
ReadS [CreateConnector]
(Int -> ReadS CreateConnector)
-> ReadS [CreateConnector]
-> ReadPrec CreateConnector
-> ReadPrec [CreateConnector]
-> Read CreateConnector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConnector]
$creadListPrec :: ReadPrec [CreateConnector]
readPrec :: ReadPrec CreateConnector
$creadPrec :: ReadPrec CreateConnector
readList :: ReadS [CreateConnector]
$creadList :: ReadS [CreateConnector]
readsPrec :: Int -> ReadS CreateConnector
$creadsPrec :: Int -> ReadS CreateConnector
Prelude.Read, Int -> CreateConnector -> ShowS
[CreateConnector] -> ShowS
CreateConnector -> String
(Int -> CreateConnector -> ShowS)
-> (CreateConnector -> String)
-> ([CreateConnector] -> ShowS)
-> Show CreateConnector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnector] -> ShowS
$cshowList :: [CreateConnector] -> ShowS
show :: CreateConnector -> String
$cshow :: CreateConnector -> String
showsPrec :: Int -> CreateConnector -> ShowS
$cshowsPrec :: Int -> CreateConnector -> ShowS
Prelude.Show, (forall x. CreateConnector -> Rep CreateConnector x)
-> (forall x. Rep CreateConnector x -> CreateConnector)
-> Generic CreateConnector
forall x. Rep CreateConnector x -> CreateConnector
forall x. CreateConnector -> Rep CreateConnector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateConnector x -> CreateConnector
$cfrom :: forall x. CreateConnector -> Rep CreateConnector x
Prelude.Generic)
newCreateConnector ::
Capacity ->
Prelude.Text ->
KafkaCluster ->
KafkaClusterClientAuthentication ->
KafkaClusterEncryptionInTransit ->
Prelude.Text ->
Prelude.Text ->
CreateConnector
newCreateConnector :: Capacity
-> Text
-> KafkaCluster
-> KafkaClusterClientAuthentication
-> KafkaClusterEncryptionInTransit
-> Text
-> Text
-> CreateConnector
newCreateConnector
Capacity
pCapacity_
Text
pConnectorName_
KafkaCluster
pKafkaCluster_
KafkaClusterClientAuthentication
pKafkaClusterClientAuthentication_
KafkaClusterEncryptionInTransit
pKafkaClusterEncryptionInTransit_
Text
pKafkaConnectVersion_
Text
pServiceExecutionRoleArn_ =
CreateConnector' :: Maybe LogDelivery
-> Maybe WorkerConfiguration
-> Maybe Text
-> Capacity
-> HashMap Text Text
-> Text
-> KafkaCluster
-> KafkaClusterClientAuthentication
-> KafkaClusterEncryptionInTransit
-> Text
-> [Plugin]
-> Text
-> CreateConnector
CreateConnector'
{ $sel:logDelivery:CreateConnector' :: Maybe LogDelivery
logDelivery = Maybe LogDelivery
forall a. Maybe a
Prelude.Nothing,
$sel:workerConfiguration:CreateConnector' :: Maybe WorkerConfiguration
workerConfiguration = Maybe WorkerConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:connectorDescription:CreateConnector' :: Maybe Text
connectorDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:capacity:CreateConnector' :: Capacity
capacity = Capacity
pCapacity_,
$sel:connectorConfiguration:CreateConnector' :: HashMap Text Text
connectorConfiguration = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty,
$sel:connectorName:CreateConnector' :: Text
connectorName = Text
pConnectorName_,
$sel:kafkaCluster:CreateConnector' :: KafkaCluster
kafkaCluster = KafkaCluster
pKafkaCluster_,
$sel:kafkaClusterClientAuthentication:CreateConnector' :: KafkaClusterClientAuthentication
kafkaClusterClientAuthentication =
KafkaClusterClientAuthentication
pKafkaClusterClientAuthentication_,
$sel:kafkaClusterEncryptionInTransit:CreateConnector' :: KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit =
KafkaClusterEncryptionInTransit
pKafkaClusterEncryptionInTransit_,
$sel:kafkaConnectVersion:CreateConnector' :: Text
kafkaConnectVersion = Text
pKafkaConnectVersion_,
$sel:plugins:CreateConnector' :: [Plugin]
plugins = [Plugin]
forall a. Monoid a => a
Prelude.mempty,
$sel:serviceExecutionRoleArn:CreateConnector' :: Text
serviceExecutionRoleArn = Text
pServiceExecutionRoleArn_
}
createConnector_logDelivery :: Lens.Lens' CreateConnector (Prelude.Maybe LogDelivery)
createConnector_logDelivery :: (Maybe LogDelivery -> f (Maybe LogDelivery))
-> CreateConnector -> f CreateConnector
createConnector_logDelivery = (CreateConnector -> Maybe LogDelivery)
-> (CreateConnector -> Maybe LogDelivery -> CreateConnector)
-> Lens
CreateConnector
CreateConnector
(Maybe LogDelivery)
(Maybe LogDelivery)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Maybe LogDelivery
logDelivery :: Maybe LogDelivery
$sel:logDelivery:CreateConnector' :: CreateConnector -> Maybe LogDelivery
logDelivery} -> Maybe LogDelivery
logDelivery) (\s :: CreateConnector
s@CreateConnector' {} Maybe LogDelivery
a -> CreateConnector
s {$sel:logDelivery:CreateConnector' :: Maybe LogDelivery
logDelivery = Maybe LogDelivery
a} :: CreateConnector)
createConnector_workerConfiguration :: Lens.Lens' CreateConnector (Prelude.Maybe WorkerConfiguration)
createConnector_workerConfiguration :: (Maybe WorkerConfiguration -> f (Maybe WorkerConfiguration))
-> CreateConnector -> f CreateConnector
createConnector_workerConfiguration = (CreateConnector -> Maybe WorkerConfiguration)
-> (CreateConnector
-> Maybe WorkerConfiguration -> CreateConnector)
-> Lens
CreateConnector
CreateConnector
(Maybe WorkerConfiguration)
(Maybe WorkerConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Maybe WorkerConfiguration
workerConfiguration :: Maybe WorkerConfiguration
$sel:workerConfiguration:CreateConnector' :: CreateConnector -> Maybe WorkerConfiguration
workerConfiguration} -> Maybe WorkerConfiguration
workerConfiguration) (\s :: CreateConnector
s@CreateConnector' {} Maybe WorkerConfiguration
a -> CreateConnector
s {$sel:workerConfiguration:CreateConnector' :: Maybe WorkerConfiguration
workerConfiguration = Maybe WorkerConfiguration
a} :: CreateConnector)
createConnector_connectorDescription :: Lens.Lens' CreateConnector (Prelude.Maybe Prelude.Text)
createConnector_connectorDescription :: (Maybe Text -> f (Maybe Text))
-> CreateConnector -> f CreateConnector
createConnector_connectorDescription = (CreateConnector -> Maybe Text)
-> (CreateConnector -> Maybe Text -> CreateConnector)
-> Lens CreateConnector CreateConnector (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Maybe Text
connectorDescription :: Maybe Text
$sel:connectorDescription:CreateConnector' :: CreateConnector -> Maybe Text
connectorDescription} -> Maybe Text
connectorDescription) (\s :: CreateConnector
s@CreateConnector' {} Maybe Text
a -> CreateConnector
s {$sel:connectorDescription:CreateConnector' :: Maybe Text
connectorDescription = Maybe Text
a} :: CreateConnector)
createConnector_capacity :: Lens.Lens' CreateConnector Capacity
createConnector_capacity :: (Capacity -> f Capacity) -> CreateConnector -> f CreateConnector
createConnector_capacity = (CreateConnector -> Capacity)
-> (CreateConnector -> Capacity -> CreateConnector)
-> Lens CreateConnector CreateConnector Capacity Capacity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Capacity
capacity :: Capacity
$sel:capacity:CreateConnector' :: CreateConnector -> Capacity
capacity} -> Capacity
capacity) (\s :: CreateConnector
s@CreateConnector' {} Capacity
a -> CreateConnector
s {$sel:capacity:CreateConnector' :: Capacity
capacity = Capacity
a} :: CreateConnector)
createConnector_connectorConfiguration :: Lens.Lens' CreateConnector (Prelude.HashMap Prelude.Text Prelude.Text)
createConnector_connectorConfiguration :: (HashMap Text Text -> f (HashMap Text Text))
-> CreateConnector -> f CreateConnector
createConnector_connectorConfiguration = (CreateConnector -> HashMap Text Text)
-> (CreateConnector -> HashMap Text Text -> CreateConnector)
-> Lens
CreateConnector
CreateConnector
(HashMap Text Text)
(HashMap Text Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {HashMap Text Text
connectorConfiguration :: HashMap Text Text
$sel:connectorConfiguration:CreateConnector' :: CreateConnector -> HashMap Text Text
connectorConfiguration} -> HashMap Text Text
connectorConfiguration) (\s :: CreateConnector
s@CreateConnector' {} HashMap Text Text
a -> CreateConnector
s {$sel:connectorConfiguration:CreateConnector' :: HashMap Text Text
connectorConfiguration = HashMap Text Text
a} :: CreateConnector) ((HashMap Text Text -> f (HashMap Text Text))
-> CreateConnector -> f CreateConnector)
-> ((HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> CreateConnector
-> f CreateConnector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createConnector_connectorName :: Lens.Lens' CreateConnector Prelude.Text
createConnector_connectorName :: (Text -> f Text) -> CreateConnector -> f CreateConnector
createConnector_connectorName = (CreateConnector -> Text)
-> (CreateConnector -> Text -> CreateConnector)
-> Lens CreateConnector CreateConnector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Text
connectorName :: Text
$sel:connectorName:CreateConnector' :: CreateConnector -> Text
connectorName} -> Text
connectorName) (\s :: CreateConnector
s@CreateConnector' {} Text
a -> CreateConnector
s {$sel:connectorName:CreateConnector' :: Text
connectorName = Text
a} :: CreateConnector)
createConnector_kafkaCluster :: Lens.Lens' CreateConnector KafkaCluster
createConnector_kafkaCluster :: (KafkaCluster -> f KafkaCluster)
-> CreateConnector -> f CreateConnector
createConnector_kafkaCluster = (CreateConnector -> KafkaCluster)
-> (CreateConnector -> KafkaCluster -> CreateConnector)
-> Lens CreateConnector CreateConnector KafkaCluster KafkaCluster
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {KafkaCluster
kafkaCluster :: KafkaCluster
$sel:kafkaCluster:CreateConnector' :: CreateConnector -> KafkaCluster
kafkaCluster} -> KafkaCluster
kafkaCluster) (\s :: CreateConnector
s@CreateConnector' {} KafkaCluster
a -> CreateConnector
s {$sel:kafkaCluster:CreateConnector' :: KafkaCluster
kafkaCluster = KafkaCluster
a} :: CreateConnector)
createConnector_kafkaClusterClientAuthentication :: Lens.Lens' CreateConnector KafkaClusterClientAuthentication
createConnector_kafkaClusterClientAuthentication :: (KafkaClusterClientAuthentication
-> f KafkaClusterClientAuthentication)
-> CreateConnector -> f CreateConnector
createConnector_kafkaClusterClientAuthentication = (CreateConnector -> KafkaClusterClientAuthentication)
-> (CreateConnector
-> KafkaClusterClientAuthentication -> CreateConnector)
-> Lens
CreateConnector
CreateConnector
KafkaClusterClientAuthentication
KafkaClusterClientAuthentication
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {KafkaClusterClientAuthentication
kafkaClusterClientAuthentication :: KafkaClusterClientAuthentication
$sel:kafkaClusterClientAuthentication:CreateConnector' :: CreateConnector -> KafkaClusterClientAuthentication
kafkaClusterClientAuthentication} -> KafkaClusterClientAuthentication
kafkaClusterClientAuthentication) (\s :: CreateConnector
s@CreateConnector' {} KafkaClusterClientAuthentication
a -> CreateConnector
s {$sel:kafkaClusterClientAuthentication:CreateConnector' :: KafkaClusterClientAuthentication
kafkaClusterClientAuthentication = KafkaClusterClientAuthentication
a} :: CreateConnector)
createConnector_kafkaClusterEncryptionInTransit :: Lens.Lens' CreateConnector KafkaClusterEncryptionInTransit
createConnector_kafkaClusterEncryptionInTransit :: (KafkaClusterEncryptionInTransit
-> f KafkaClusterEncryptionInTransit)
-> CreateConnector -> f CreateConnector
createConnector_kafkaClusterEncryptionInTransit = (CreateConnector -> KafkaClusterEncryptionInTransit)
-> (CreateConnector
-> KafkaClusterEncryptionInTransit -> CreateConnector)
-> Lens
CreateConnector
CreateConnector
KafkaClusterEncryptionInTransit
KafkaClusterEncryptionInTransit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit :: KafkaClusterEncryptionInTransit
$sel:kafkaClusterEncryptionInTransit:CreateConnector' :: CreateConnector -> KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit} -> KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit) (\s :: CreateConnector
s@CreateConnector' {} KafkaClusterEncryptionInTransit
a -> CreateConnector
s {$sel:kafkaClusterEncryptionInTransit:CreateConnector' :: KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit = KafkaClusterEncryptionInTransit
a} :: CreateConnector)
createConnector_kafkaConnectVersion :: Lens.Lens' CreateConnector Prelude.Text
createConnector_kafkaConnectVersion :: (Text -> f Text) -> CreateConnector -> f CreateConnector
createConnector_kafkaConnectVersion = (CreateConnector -> Text)
-> (CreateConnector -> Text -> CreateConnector)
-> Lens CreateConnector CreateConnector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Text
kafkaConnectVersion :: Text
$sel:kafkaConnectVersion:CreateConnector' :: CreateConnector -> Text
kafkaConnectVersion} -> Text
kafkaConnectVersion) (\s :: CreateConnector
s@CreateConnector' {} Text
a -> CreateConnector
s {$sel:kafkaConnectVersion:CreateConnector' :: Text
kafkaConnectVersion = Text
a} :: CreateConnector)
createConnector_plugins :: Lens.Lens' CreateConnector [Plugin]
createConnector_plugins :: ([Plugin] -> f [Plugin]) -> CreateConnector -> f CreateConnector
createConnector_plugins = (CreateConnector -> [Plugin])
-> (CreateConnector -> [Plugin] -> CreateConnector)
-> Lens CreateConnector CreateConnector [Plugin] [Plugin]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {[Plugin]
plugins :: [Plugin]
$sel:plugins:CreateConnector' :: CreateConnector -> [Plugin]
plugins} -> [Plugin]
plugins) (\s :: CreateConnector
s@CreateConnector' {} [Plugin]
a -> CreateConnector
s {$sel:plugins:CreateConnector' :: [Plugin]
plugins = [Plugin]
a} :: CreateConnector) (([Plugin] -> f [Plugin]) -> CreateConnector -> f CreateConnector)
-> (([Plugin] -> f [Plugin]) -> [Plugin] -> f [Plugin])
-> ([Plugin] -> f [Plugin])
-> CreateConnector
-> f CreateConnector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Plugin] -> f [Plugin]) -> [Plugin] -> f [Plugin]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createConnector_serviceExecutionRoleArn :: Lens.Lens' CreateConnector Prelude.Text
createConnector_serviceExecutionRoleArn :: (Text -> f Text) -> CreateConnector -> f CreateConnector
createConnector_serviceExecutionRoleArn = (CreateConnector -> Text)
-> (CreateConnector -> Text -> CreateConnector)
-> Lens CreateConnector CreateConnector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnector' {Text
serviceExecutionRoleArn :: Text
$sel:serviceExecutionRoleArn:CreateConnector' :: CreateConnector -> Text
serviceExecutionRoleArn} -> Text
serviceExecutionRoleArn) (\s :: CreateConnector
s@CreateConnector' {} Text
a -> CreateConnector
s {$sel:serviceExecutionRoleArn:CreateConnector' :: Text
serviceExecutionRoleArn = Text
a} :: CreateConnector)
instance Core.AWSRequest CreateConnector where
type
AWSResponse CreateConnector =
CreateConnectorResponse
request :: CreateConnector -> Request CreateConnector
request = Service -> CreateConnector -> Request CreateConnector
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateConnector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateConnector)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateConnector))
-> Logger
-> Service
-> Proxy CreateConnector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateConnector)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe Text
-> Maybe ConnectorState
-> Int
-> CreateConnectorResponse
CreateConnectorResponse'
(Maybe Text
-> Maybe Text
-> Maybe ConnectorState
-> Int
-> CreateConnectorResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ConnectorState -> Int -> CreateConnectorResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"connectorArn")
Either
String
(Maybe Text
-> Maybe ConnectorState -> Int -> CreateConnectorResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe ConnectorState -> Int -> CreateConnectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"connectorName")
Either
String (Maybe ConnectorState -> Int -> CreateConnectorResponse)
-> Either String (Maybe ConnectorState)
-> Either String (Int -> CreateConnectorResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ConnectorState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"connectorState")
Either String (Int -> CreateConnectorResponse)
-> Either String Int -> Either String CreateConnectorResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateConnector
instance Prelude.NFData CreateConnector
instance Core.ToHeaders CreateConnector where
toHeaders :: CreateConnector -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateConnector -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateConnector where
toJSON :: CreateConnector -> Value
toJSON CreateConnector' {[Plugin]
Maybe Text
Maybe WorkerConfiguration
Maybe LogDelivery
Text
HashMap Text Text
KafkaClusterClientAuthentication
KafkaClusterEncryptionInTransit
Capacity
KafkaCluster
serviceExecutionRoleArn :: Text
plugins :: [Plugin]
kafkaConnectVersion :: Text
kafkaClusterEncryptionInTransit :: KafkaClusterEncryptionInTransit
kafkaClusterClientAuthentication :: KafkaClusterClientAuthentication
kafkaCluster :: KafkaCluster
connectorName :: Text
connectorConfiguration :: HashMap Text Text
capacity :: Capacity
connectorDescription :: Maybe Text
workerConfiguration :: Maybe WorkerConfiguration
logDelivery :: Maybe LogDelivery
$sel:serviceExecutionRoleArn:CreateConnector' :: CreateConnector -> Text
$sel:plugins:CreateConnector' :: CreateConnector -> [Plugin]
$sel:kafkaConnectVersion:CreateConnector' :: CreateConnector -> Text
$sel:kafkaClusterEncryptionInTransit:CreateConnector' :: CreateConnector -> KafkaClusterEncryptionInTransit
$sel:kafkaClusterClientAuthentication:CreateConnector' :: CreateConnector -> KafkaClusterClientAuthentication
$sel:kafkaCluster:CreateConnector' :: CreateConnector -> KafkaCluster
$sel:connectorName:CreateConnector' :: CreateConnector -> Text
$sel:connectorConfiguration:CreateConnector' :: CreateConnector -> HashMap Text Text
$sel:capacity:CreateConnector' :: CreateConnector -> Capacity
$sel:connectorDescription:CreateConnector' :: CreateConnector -> Maybe Text
$sel:workerConfiguration:CreateConnector' :: CreateConnector -> Maybe WorkerConfiguration
$sel:logDelivery:CreateConnector' :: CreateConnector -> Maybe LogDelivery
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"logDelivery" Text -> LogDelivery -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LogDelivery -> Pair) -> Maybe LogDelivery -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LogDelivery
logDelivery,
(Text
"workerConfiguration" Text -> WorkerConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(WorkerConfiguration -> Pair)
-> Maybe WorkerConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkerConfiguration
workerConfiguration,
(Text
"connectorDescription" 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
connectorDescription,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"capacity" Text -> Capacity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Capacity
capacity),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"connectorConfiguration"
Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text Text
connectorConfiguration
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"connectorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectorName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"kafkaCluster" Text -> KafkaCluster -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= KafkaCluster
kafkaCluster),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"kafkaClusterClientAuthentication"
Text -> KafkaClusterClientAuthentication -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= KafkaClusterClientAuthentication
kafkaClusterClientAuthentication
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"kafkaClusterEncryptionInTransit"
Text -> KafkaClusterEncryptionInTransit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= KafkaClusterEncryptionInTransit
kafkaClusterEncryptionInTransit
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"kafkaConnectVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
kafkaConnectVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"plugins" Text -> [Plugin] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Plugin]
plugins),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"serviceExecutionRoleArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceExecutionRoleArn
)
]
)
instance Core.ToPath CreateConnector where
toPath :: CreateConnector -> ByteString
toPath = ByteString -> CreateConnector -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/connectors"
instance Core.ToQuery CreateConnector where
toQuery :: CreateConnector -> QueryString
toQuery = QueryString -> CreateConnector -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateConnectorResponse = CreateConnectorResponse'
{
CreateConnectorResponse -> Maybe Text
connectorArn :: Prelude.Maybe Prelude.Text,
CreateConnectorResponse -> Maybe Text
connectorName :: Prelude.Maybe Prelude.Text,
CreateConnectorResponse -> Maybe ConnectorState
connectorState :: Prelude.Maybe ConnectorState,
CreateConnectorResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateConnectorResponse -> CreateConnectorResponse -> Bool
(CreateConnectorResponse -> CreateConnectorResponse -> Bool)
-> (CreateConnectorResponse -> CreateConnectorResponse -> Bool)
-> Eq CreateConnectorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnectorResponse -> CreateConnectorResponse -> Bool
$c/= :: CreateConnectorResponse -> CreateConnectorResponse -> Bool
== :: CreateConnectorResponse -> CreateConnectorResponse -> Bool
$c== :: CreateConnectorResponse -> CreateConnectorResponse -> Bool
Prelude.Eq, ReadPrec [CreateConnectorResponse]
ReadPrec CreateConnectorResponse
Int -> ReadS CreateConnectorResponse
ReadS [CreateConnectorResponse]
(Int -> ReadS CreateConnectorResponse)
-> ReadS [CreateConnectorResponse]
-> ReadPrec CreateConnectorResponse
-> ReadPrec [CreateConnectorResponse]
-> Read CreateConnectorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConnectorResponse]
$creadListPrec :: ReadPrec [CreateConnectorResponse]
readPrec :: ReadPrec CreateConnectorResponse
$creadPrec :: ReadPrec CreateConnectorResponse
readList :: ReadS [CreateConnectorResponse]
$creadList :: ReadS [CreateConnectorResponse]
readsPrec :: Int -> ReadS CreateConnectorResponse
$creadsPrec :: Int -> ReadS CreateConnectorResponse
Prelude.Read, Int -> CreateConnectorResponse -> ShowS
[CreateConnectorResponse] -> ShowS
CreateConnectorResponse -> String
(Int -> CreateConnectorResponse -> ShowS)
-> (CreateConnectorResponse -> String)
-> ([CreateConnectorResponse] -> ShowS)
-> Show CreateConnectorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnectorResponse] -> ShowS
$cshowList :: [CreateConnectorResponse] -> ShowS
show :: CreateConnectorResponse -> String
$cshow :: CreateConnectorResponse -> String
showsPrec :: Int -> CreateConnectorResponse -> ShowS
$cshowsPrec :: Int -> CreateConnectorResponse -> ShowS
Prelude.Show, (forall x.
CreateConnectorResponse -> Rep CreateConnectorResponse x)
-> (forall x.
Rep CreateConnectorResponse x -> CreateConnectorResponse)
-> Generic CreateConnectorResponse
forall x. Rep CreateConnectorResponse x -> CreateConnectorResponse
forall x. CreateConnectorResponse -> Rep CreateConnectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateConnectorResponse x -> CreateConnectorResponse
$cfrom :: forall x. CreateConnectorResponse -> Rep CreateConnectorResponse x
Prelude.Generic)
newCreateConnectorResponse ::
Prelude.Int ->
CreateConnectorResponse
newCreateConnectorResponse :: Int -> CreateConnectorResponse
newCreateConnectorResponse Int
pHttpStatus_ =
CreateConnectorResponse' :: Maybe Text
-> Maybe Text
-> Maybe ConnectorState
-> Int
-> CreateConnectorResponse
CreateConnectorResponse'
{ $sel:connectorArn:CreateConnectorResponse' :: Maybe Text
connectorArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectorName:CreateConnectorResponse' :: Maybe Text
connectorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectorState:CreateConnectorResponse' :: Maybe ConnectorState
connectorState = Maybe ConnectorState
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateConnectorResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createConnectorResponse_connectorArn :: Lens.Lens' CreateConnectorResponse (Prelude.Maybe Prelude.Text)
createConnectorResponse_connectorArn :: (Maybe Text -> f (Maybe Text))
-> CreateConnectorResponse -> f CreateConnectorResponse
createConnectorResponse_connectorArn = (CreateConnectorResponse -> Maybe Text)
-> (CreateConnectorResponse
-> Maybe Text -> CreateConnectorResponse)
-> Lens
CreateConnectorResponse
CreateConnectorResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorResponse' {Maybe Text
connectorArn :: Maybe Text
$sel:connectorArn:CreateConnectorResponse' :: CreateConnectorResponse -> Maybe Text
connectorArn} -> Maybe Text
connectorArn) (\s :: CreateConnectorResponse
s@CreateConnectorResponse' {} Maybe Text
a -> CreateConnectorResponse
s {$sel:connectorArn:CreateConnectorResponse' :: Maybe Text
connectorArn = Maybe Text
a} :: CreateConnectorResponse)
createConnectorResponse_connectorName :: Lens.Lens' CreateConnectorResponse (Prelude.Maybe Prelude.Text)
createConnectorResponse_connectorName :: (Maybe Text -> f (Maybe Text))
-> CreateConnectorResponse -> f CreateConnectorResponse
createConnectorResponse_connectorName = (CreateConnectorResponse -> Maybe Text)
-> (CreateConnectorResponse
-> Maybe Text -> CreateConnectorResponse)
-> Lens
CreateConnectorResponse
CreateConnectorResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorResponse' {Maybe Text
connectorName :: Maybe Text
$sel:connectorName:CreateConnectorResponse' :: CreateConnectorResponse -> Maybe Text
connectorName} -> Maybe Text
connectorName) (\s :: CreateConnectorResponse
s@CreateConnectorResponse' {} Maybe Text
a -> CreateConnectorResponse
s {$sel:connectorName:CreateConnectorResponse' :: Maybe Text
connectorName = Maybe Text
a} :: CreateConnectorResponse)
createConnectorResponse_connectorState :: Lens.Lens' CreateConnectorResponse (Prelude.Maybe ConnectorState)
createConnectorResponse_connectorState :: (Maybe ConnectorState -> f (Maybe ConnectorState))
-> CreateConnectorResponse -> f CreateConnectorResponse
createConnectorResponse_connectorState = (CreateConnectorResponse -> Maybe ConnectorState)
-> (CreateConnectorResponse
-> Maybe ConnectorState -> CreateConnectorResponse)
-> Lens
CreateConnectorResponse
CreateConnectorResponse
(Maybe ConnectorState)
(Maybe ConnectorState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorResponse' {Maybe ConnectorState
connectorState :: Maybe ConnectorState
$sel:connectorState:CreateConnectorResponse' :: CreateConnectorResponse -> Maybe ConnectorState
connectorState} -> Maybe ConnectorState
connectorState) (\s :: CreateConnectorResponse
s@CreateConnectorResponse' {} Maybe ConnectorState
a -> CreateConnectorResponse
s {$sel:connectorState:CreateConnectorResponse' :: Maybe ConnectorState
connectorState = Maybe ConnectorState
a} :: CreateConnectorResponse)
createConnectorResponse_httpStatus :: Lens.Lens' CreateConnectorResponse Prelude.Int
createConnectorResponse_httpStatus :: (Int -> f Int)
-> CreateConnectorResponse -> f CreateConnectorResponse
createConnectorResponse_httpStatus = (CreateConnectorResponse -> Int)
-> (CreateConnectorResponse -> Int -> CreateConnectorResponse)
-> Lens CreateConnectorResponse CreateConnectorResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateConnectorResponse' :: CreateConnectorResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateConnectorResponse
s@CreateConnectorResponse' {} Int
a -> CreateConnectorResponse
s {$sel:httpStatus:CreateConnectorResponse' :: Int
httpStatus = Int
a} :: CreateConnectorResponse)
instance Prelude.NFData CreateConnectorResponse