{-# 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.AppFlow.CreateConnectorProfile
(
CreateConnectorProfile (..),
newCreateConnectorProfile,
createConnectorProfile_kmsArn,
createConnectorProfile_connectorProfileName,
createConnectorProfile_connectorType,
createConnectorProfile_connectionMode,
createConnectorProfile_connectorProfileConfig,
CreateConnectorProfileResponse (..),
newCreateConnectorProfileResponse,
createConnectorProfileResponse_connectorProfileArn,
createConnectorProfileResponse_httpStatus,
)
where
import Amazonka.AppFlow.Types
import qualified Amazonka.Core as Core
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 CreateConnectorProfile = CreateConnectorProfile'
{
CreateConnectorProfile -> Maybe Text
kmsArn :: Prelude.Maybe Prelude.Text,
CreateConnectorProfile -> Text
connectorProfileName :: Prelude.Text,
CreateConnectorProfile -> ConnectorType
connectorType :: ConnectorType,
CreateConnectorProfile -> ConnectionMode
connectionMode :: ConnectionMode,
CreateConnectorProfile -> ConnectorProfileConfig
connectorProfileConfig :: ConnectorProfileConfig
}
deriving (CreateConnectorProfile -> CreateConnectorProfile -> Bool
(CreateConnectorProfile -> CreateConnectorProfile -> Bool)
-> (CreateConnectorProfile -> CreateConnectorProfile -> Bool)
-> Eq CreateConnectorProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnectorProfile -> CreateConnectorProfile -> Bool
$c/= :: CreateConnectorProfile -> CreateConnectorProfile -> Bool
== :: CreateConnectorProfile -> CreateConnectorProfile -> Bool
$c== :: CreateConnectorProfile -> CreateConnectorProfile -> Bool
Prelude.Eq, Int -> CreateConnectorProfile -> ShowS
[CreateConnectorProfile] -> ShowS
CreateConnectorProfile -> String
(Int -> CreateConnectorProfile -> ShowS)
-> (CreateConnectorProfile -> String)
-> ([CreateConnectorProfile] -> ShowS)
-> Show CreateConnectorProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnectorProfile] -> ShowS
$cshowList :: [CreateConnectorProfile] -> ShowS
show :: CreateConnectorProfile -> String
$cshow :: CreateConnectorProfile -> String
showsPrec :: Int -> CreateConnectorProfile -> ShowS
$cshowsPrec :: Int -> CreateConnectorProfile -> ShowS
Prelude.Show, (forall x. CreateConnectorProfile -> Rep CreateConnectorProfile x)
-> (forall x.
Rep CreateConnectorProfile x -> CreateConnectorProfile)
-> Generic CreateConnectorProfile
forall x. Rep CreateConnectorProfile x -> CreateConnectorProfile
forall x. CreateConnectorProfile -> Rep CreateConnectorProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateConnectorProfile x -> CreateConnectorProfile
$cfrom :: forall x. CreateConnectorProfile -> Rep CreateConnectorProfile x
Prelude.Generic)
newCreateConnectorProfile ::
Prelude.Text ->
ConnectorType ->
ConnectionMode ->
ConnectorProfileConfig ->
CreateConnectorProfile
newCreateConnectorProfile :: Text
-> ConnectorType
-> ConnectionMode
-> ConnectorProfileConfig
-> CreateConnectorProfile
newCreateConnectorProfile
Text
pConnectorProfileName_
ConnectorType
pConnectorType_
ConnectionMode
pConnectionMode_
ConnectorProfileConfig
pConnectorProfileConfig_ =
CreateConnectorProfile' :: Maybe Text
-> Text
-> ConnectorType
-> ConnectionMode
-> ConnectorProfileConfig
-> CreateConnectorProfile
CreateConnectorProfile'
{ $sel:kmsArn:CreateConnectorProfile' :: Maybe Text
kmsArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectorProfileName:CreateConnectorProfile' :: Text
connectorProfileName = Text
pConnectorProfileName_,
$sel:connectorType:CreateConnectorProfile' :: ConnectorType
connectorType = ConnectorType
pConnectorType_,
$sel:connectionMode:CreateConnectorProfile' :: ConnectionMode
connectionMode = ConnectionMode
pConnectionMode_,
$sel:connectorProfileConfig:CreateConnectorProfile' :: ConnectorProfileConfig
connectorProfileConfig = ConnectorProfileConfig
pConnectorProfileConfig_
}
createConnectorProfile_kmsArn :: Lens.Lens' CreateConnectorProfile (Prelude.Maybe Prelude.Text)
createConnectorProfile_kmsArn :: (Maybe Text -> f (Maybe Text))
-> CreateConnectorProfile -> f CreateConnectorProfile
createConnectorProfile_kmsArn = (CreateConnectorProfile -> Maybe Text)
-> (CreateConnectorProfile -> Maybe Text -> CreateConnectorProfile)
-> Lens
CreateConnectorProfile
CreateConnectorProfile
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfile' {Maybe Text
kmsArn :: Maybe Text
$sel:kmsArn:CreateConnectorProfile' :: CreateConnectorProfile -> Maybe Text
kmsArn} -> Maybe Text
kmsArn) (\s :: CreateConnectorProfile
s@CreateConnectorProfile' {} Maybe Text
a -> CreateConnectorProfile
s {$sel:kmsArn:CreateConnectorProfile' :: Maybe Text
kmsArn = Maybe Text
a} :: CreateConnectorProfile)
createConnectorProfile_connectorProfileName :: Lens.Lens' CreateConnectorProfile Prelude.Text
createConnectorProfile_connectorProfileName :: (Text -> f Text)
-> CreateConnectorProfile -> f CreateConnectorProfile
createConnectorProfile_connectorProfileName = (CreateConnectorProfile -> Text)
-> (CreateConnectorProfile -> Text -> CreateConnectorProfile)
-> Lens CreateConnectorProfile CreateConnectorProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfile' {Text
connectorProfileName :: Text
$sel:connectorProfileName:CreateConnectorProfile' :: CreateConnectorProfile -> Text
connectorProfileName} -> Text
connectorProfileName) (\s :: CreateConnectorProfile
s@CreateConnectorProfile' {} Text
a -> CreateConnectorProfile
s {$sel:connectorProfileName:CreateConnectorProfile' :: Text
connectorProfileName = Text
a} :: CreateConnectorProfile)
createConnectorProfile_connectorType :: Lens.Lens' CreateConnectorProfile ConnectorType
createConnectorProfile_connectorType :: (ConnectorType -> f ConnectorType)
-> CreateConnectorProfile -> f CreateConnectorProfile
createConnectorProfile_connectorType = (CreateConnectorProfile -> ConnectorType)
-> (CreateConnectorProfile
-> ConnectorType -> CreateConnectorProfile)
-> Lens
CreateConnectorProfile
CreateConnectorProfile
ConnectorType
ConnectorType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfile' {ConnectorType
connectorType :: ConnectorType
$sel:connectorType:CreateConnectorProfile' :: CreateConnectorProfile -> ConnectorType
connectorType} -> ConnectorType
connectorType) (\s :: CreateConnectorProfile
s@CreateConnectorProfile' {} ConnectorType
a -> CreateConnectorProfile
s {$sel:connectorType:CreateConnectorProfile' :: ConnectorType
connectorType = ConnectorType
a} :: CreateConnectorProfile)
createConnectorProfile_connectionMode :: Lens.Lens' CreateConnectorProfile ConnectionMode
createConnectorProfile_connectionMode :: (ConnectionMode -> f ConnectionMode)
-> CreateConnectorProfile -> f CreateConnectorProfile
createConnectorProfile_connectionMode = (CreateConnectorProfile -> ConnectionMode)
-> (CreateConnectorProfile
-> ConnectionMode -> CreateConnectorProfile)
-> Lens
CreateConnectorProfile
CreateConnectorProfile
ConnectionMode
ConnectionMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfile' {ConnectionMode
connectionMode :: ConnectionMode
$sel:connectionMode:CreateConnectorProfile' :: CreateConnectorProfile -> ConnectionMode
connectionMode} -> ConnectionMode
connectionMode) (\s :: CreateConnectorProfile
s@CreateConnectorProfile' {} ConnectionMode
a -> CreateConnectorProfile
s {$sel:connectionMode:CreateConnectorProfile' :: ConnectionMode
connectionMode = ConnectionMode
a} :: CreateConnectorProfile)
createConnectorProfile_connectorProfileConfig :: Lens.Lens' CreateConnectorProfile ConnectorProfileConfig
createConnectorProfile_connectorProfileConfig :: (ConnectorProfileConfig -> f ConnectorProfileConfig)
-> CreateConnectorProfile -> f CreateConnectorProfile
createConnectorProfile_connectorProfileConfig = (CreateConnectorProfile -> ConnectorProfileConfig)
-> (CreateConnectorProfile
-> ConnectorProfileConfig -> CreateConnectorProfile)
-> Lens
CreateConnectorProfile
CreateConnectorProfile
ConnectorProfileConfig
ConnectorProfileConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfile' {ConnectorProfileConfig
connectorProfileConfig :: ConnectorProfileConfig
$sel:connectorProfileConfig:CreateConnectorProfile' :: CreateConnectorProfile -> ConnectorProfileConfig
connectorProfileConfig} -> ConnectorProfileConfig
connectorProfileConfig) (\s :: CreateConnectorProfile
s@CreateConnectorProfile' {} ConnectorProfileConfig
a -> CreateConnectorProfile
s {$sel:connectorProfileConfig:CreateConnectorProfile' :: ConnectorProfileConfig
connectorProfileConfig = ConnectorProfileConfig
a} :: CreateConnectorProfile)
instance Core.AWSRequest CreateConnectorProfile where
type
AWSResponse CreateConnectorProfile =
CreateConnectorProfileResponse
request :: CreateConnectorProfile -> Request CreateConnectorProfile
request = Service -> CreateConnectorProfile -> Request CreateConnectorProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateConnectorProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateConnectorProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateConnectorProfile))
-> Logger
-> Service
-> Proxy CreateConnectorProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateConnectorProfile)))
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 -> Int -> CreateConnectorProfileResponse
CreateConnectorProfileResponse'
(Maybe Text -> Int -> CreateConnectorProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateConnectorProfileResponse)
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
"connectorProfileArn")
Either String (Int -> CreateConnectorProfileResponse)
-> Either String Int
-> Either String CreateConnectorProfileResponse
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 CreateConnectorProfile
instance Prelude.NFData CreateConnectorProfile
instance Core.ToHeaders CreateConnectorProfile where
toHeaders :: CreateConnectorProfile -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateConnectorProfile -> 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 CreateConnectorProfile where
toJSON :: CreateConnectorProfile -> Value
toJSON CreateConnectorProfile' {Maybe Text
Text
ConnectionMode
ConnectorType
ConnectorProfileConfig
connectorProfileConfig :: ConnectorProfileConfig
connectionMode :: ConnectionMode
connectorType :: ConnectorType
connectorProfileName :: Text
kmsArn :: Maybe Text
$sel:connectorProfileConfig:CreateConnectorProfile' :: CreateConnectorProfile -> ConnectorProfileConfig
$sel:connectionMode:CreateConnectorProfile' :: CreateConnectorProfile -> ConnectionMode
$sel:connectorType:CreateConnectorProfile' :: CreateConnectorProfile -> ConnectorType
$sel:connectorProfileName:CreateConnectorProfile' :: CreateConnectorProfile -> Text
$sel:kmsArn:CreateConnectorProfile' :: CreateConnectorProfile -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"kmsArn" 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
kmsArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"connectorProfileName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectorProfileName
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"connectorType" Text -> ConnectorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectorType
connectorType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"connectionMode" Text -> ConnectionMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectionMode
connectionMode),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"connectorProfileConfig"
Text -> ConnectorProfileConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectorProfileConfig
connectorProfileConfig
)
]
)
instance Core.ToPath CreateConnectorProfile where
toPath :: CreateConnectorProfile -> ByteString
toPath = ByteString -> CreateConnectorProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/create-connector-profile"
instance Core.ToQuery CreateConnectorProfile where
toQuery :: CreateConnectorProfile -> QueryString
toQuery = QueryString -> CreateConnectorProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateConnectorProfileResponse = CreateConnectorProfileResponse'
{
CreateConnectorProfileResponse -> Maybe Text
connectorProfileArn :: Prelude.Maybe Prelude.Text,
CreateConnectorProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool
(CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool)
-> (CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool)
-> Eq CreateConnectorProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool
$c/= :: CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool
== :: CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool
$c== :: CreateConnectorProfileResponse
-> CreateConnectorProfileResponse -> Bool
Prelude.Eq, ReadPrec [CreateConnectorProfileResponse]
ReadPrec CreateConnectorProfileResponse
Int -> ReadS CreateConnectorProfileResponse
ReadS [CreateConnectorProfileResponse]
(Int -> ReadS CreateConnectorProfileResponse)
-> ReadS [CreateConnectorProfileResponse]
-> ReadPrec CreateConnectorProfileResponse
-> ReadPrec [CreateConnectorProfileResponse]
-> Read CreateConnectorProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConnectorProfileResponse]
$creadListPrec :: ReadPrec [CreateConnectorProfileResponse]
readPrec :: ReadPrec CreateConnectorProfileResponse
$creadPrec :: ReadPrec CreateConnectorProfileResponse
readList :: ReadS [CreateConnectorProfileResponse]
$creadList :: ReadS [CreateConnectorProfileResponse]
readsPrec :: Int -> ReadS CreateConnectorProfileResponse
$creadsPrec :: Int -> ReadS CreateConnectorProfileResponse
Prelude.Read, Int -> CreateConnectorProfileResponse -> ShowS
[CreateConnectorProfileResponse] -> ShowS
CreateConnectorProfileResponse -> String
(Int -> CreateConnectorProfileResponse -> ShowS)
-> (CreateConnectorProfileResponse -> String)
-> ([CreateConnectorProfileResponse] -> ShowS)
-> Show CreateConnectorProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnectorProfileResponse] -> ShowS
$cshowList :: [CreateConnectorProfileResponse] -> ShowS
show :: CreateConnectorProfileResponse -> String
$cshow :: CreateConnectorProfileResponse -> String
showsPrec :: Int -> CreateConnectorProfileResponse -> ShowS
$cshowsPrec :: Int -> CreateConnectorProfileResponse -> ShowS
Prelude.Show, (forall x.
CreateConnectorProfileResponse
-> Rep CreateConnectorProfileResponse x)
-> (forall x.
Rep CreateConnectorProfileResponse x
-> CreateConnectorProfileResponse)
-> Generic CreateConnectorProfileResponse
forall x.
Rep CreateConnectorProfileResponse x
-> CreateConnectorProfileResponse
forall x.
CreateConnectorProfileResponse
-> Rep CreateConnectorProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateConnectorProfileResponse x
-> CreateConnectorProfileResponse
$cfrom :: forall x.
CreateConnectorProfileResponse
-> Rep CreateConnectorProfileResponse x
Prelude.Generic)
newCreateConnectorProfileResponse ::
Prelude.Int ->
CreateConnectorProfileResponse
newCreateConnectorProfileResponse :: Int -> CreateConnectorProfileResponse
newCreateConnectorProfileResponse Int
pHttpStatus_ =
CreateConnectorProfileResponse' :: Maybe Text -> Int -> CreateConnectorProfileResponse
CreateConnectorProfileResponse'
{ $sel:connectorProfileArn:CreateConnectorProfileResponse' :: Maybe Text
connectorProfileArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateConnectorProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createConnectorProfileResponse_connectorProfileArn :: Lens.Lens' CreateConnectorProfileResponse (Prelude.Maybe Prelude.Text)
createConnectorProfileResponse_connectorProfileArn :: (Maybe Text -> f (Maybe Text))
-> CreateConnectorProfileResponse
-> f CreateConnectorProfileResponse
createConnectorProfileResponse_connectorProfileArn = (CreateConnectorProfileResponse -> Maybe Text)
-> (CreateConnectorProfileResponse
-> Maybe Text -> CreateConnectorProfileResponse)
-> Lens
CreateConnectorProfileResponse
CreateConnectorProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfileResponse' {Maybe Text
connectorProfileArn :: Maybe Text
$sel:connectorProfileArn:CreateConnectorProfileResponse' :: CreateConnectorProfileResponse -> Maybe Text
connectorProfileArn} -> Maybe Text
connectorProfileArn) (\s :: CreateConnectorProfileResponse
s@CreateConnectorProfileResponse' {} Maybe Text
a -> CreateConnectorProfileResponse
s {$sel:connectorProfileArn:CreateConnectorProfileResponse' :: Maybe Text
connectorProfileArn = Maybe Text
a} :: CreateConnectorProfileResponse)
createConnectorProfileResponse_httpStatus :: Lens.Lens' CreateConnectorProfileResponse Prelude.Int
createConnectorProfileResponse_httpStatus :: (Int -> f Int)
-> CreateConnectorProfileResponse
-> f CreateConnectorProfileResponse
createConnectorProfileResponse_httpStatus = (CreateConnectorProfileResponse -> Int)
-> (CreateConnectorProfileResponse
-> Int -> CreateConnectorProfileResponse)
-> Lens
CreateConnectorProfileResponse
CreateConnectorProfileResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectorProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateConnectorProfileResponse' :: CreateConnectorProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateConnectorProfileResponse
s@CreateConnectorProfileResponse' {} Int
a -> CreateConnectorProfileResponse
s {$sel:httpStatus:CreateConnectorProfileResponse' :: Int
httpStatus = Int
a} :: CreateConnectorProfileResponse)
instance
Prelude.NFData
CreateConnectorProfileResponse