{-# 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.UpdateConnectorProfile
(
UpdateConnectorProfile (..),
newUpdateConnectorProfile,
updateConnectorProfile_connectorProfileName,
updateConnectorProfile_connectionMode,
updateConnectorProfile_connectorProfileConfig,
UpdateConnectorProfileResponse (..),
newUpdateConnectorProfileResponse,
updateConnectorProfileResponse_connectorProfileArn,
updateConnectorProfileResponse_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 UpdateConnectorProfile = UpdateConnectorProfile'
{
UpdateConnectorProfile -> Text
connectorProfileName :: Prelude.Text,
UpdateConnectorProfile -> ConnectionMode
connectionMode :: ConnectionMode,
UpdateConnectorProfile -> ConnectorProfileConfig
connectorProfileConfig :: ConnectorProfileConfig
}
deriving (UpdateConnectorProfile -> UpdateConnectorProfile -> Bool
(UpdateConnectorProfile -> UpdateConnectorProfile -> Bool)
-> (UpdateConnectorProfile -> UpdateConnectorProfile -> Bool)
-> Eq UpdateConnectorProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectorProfile -> UpdateConnectorProfile -> Bool
$c/= :: UpdateConnectorProfile -> UpdateConnectorProfile -> Bool
== :: UpdateConnectorProfile -> UpdateConnectorProfile -> Bool
$c== :: UpdateConnectorProfile -> UpdateConnectorProfile -> Bool
Prelude.Eq, Int -> UpdateConnectorProfile -> ShowS
[UpdateConnectorProfile] -> ShowS
UpdateConnectorProfile -> String
(Int -> UpdateConnectorProfile -> ShowS)
-> (UpdateConnectorProfile -> String)
-> ([UpdateConnectorProfile] -> ShowS)
-> Show UpdateConnectorProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectorProfile] -> ShowS
$cshowList :: [UpdateConnectorProfile] -> ShowS
show :: UpdateConnectorProfile -> String
$cshow :: UpdateConnectorProfile -> String
showsPrec :: Int -> UpdateConnectorProfile -> ShowS
$cshowsPrec :: Int -> UpdateConnectorProfile -> ShowS
Prelude.Show, (forall x. UpdateConnectorProfile -> Rep UpdateConnectorProfile x)
-> (forall x.
Rep UpdateConnectorProfile x -> UpdateConnectorProfile)
-> Generic UpdateConnectorProfile
forall x. Rep UpdateConnectorProfile x -> UpdateConnectorProfile
forall x. UpdateConnectorProfile -> Rep UpdateConnectorProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateConnectorProfile x -> UpdateConnectorProfile
$cfrom :: forall x. UpdateConnectorProfile -> Rep UpdateConnectorProfile x
Prelude.Generic)
newUpdateConnectorProfile ::
Prelude.Text ->
ConnectionMode ->
ConnectorProfileConfig ->
UpdateConnectorProfile
newUpdateConnectorProfile :: Text
-> ConnectionMode
-> ConnectorProfileConfig
-> UpdateConnectorProfile
newUpdateConnectorProfile
Text
pConnectorProfileName_
ConnectionMode
pConnectionMode_
ConnectorProfileConfig
pConnectorProfileConfig_ =
UpdateConnectorProfile' :: Text
-> ConnectionMode
-> ConnectorProfileConfig
-> UpdateConnectorProfile
UpdateConnectorProfile'
{ $sel:connectorProfileName:UpdateConnectorProfile' :: Text
connectorProfileName =
Text
pConnectorProfileName_,
$sel:connectionMode:UpdateConnectorProfile' :: ConnectionMode
connectionMode = ConnectionMode
pConnectionMode_,
$sel:connectorProfileConfig:UpdateConnectorProfile' :: ConnectorProfileConfig
connectorProfileConfig = ConnectorProfileConfig
pConnectorProfileConfig_
}
updateConnectorProfile_connectorProfileName :: Lens.Lens' UpdateConnectorProfile Prelude.Text
updateConnectorProfile_connectorProfileName :: (Text -> f Text)
-> UpdateConnectorProfile -> f UpdateConnectorProfile
updateConnectorProfile_connectorProfileName = (UpdateConnectorProfile -> Text)
-> (UpdateConnectorProfile -> Text -> UpdateConnectorProfile)
-> Lens UpdateConnectorProfile UpdateConnectorProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectorProfile' {Text
connectorProfileName :: Text
$sel:connectorProfileName:UpdateConnectorProfile' :: UpdateConnectorProfile -> Text
connectorProfileName} -> Text
connectorProfileName) (\s :: UpdateConnectorProfile
s@UpdateConnectorProfile' {} Text
a -> UpdateConnectorProfile
s {$sel:connectorProfileName:UpdateConnectorProfile' :: Text
connectorProfileName = Text
a} :: UpdateConnectorProfile)
updateConnectorProfile_connectionMode :: Lens.Lens' UpdateConnectorProfile ConnectionMode
updateConnectorProfile_connectionMode :: (ConnectionMode -> f ConnectionMode)
-> UpdateConnectorProfile -> f UpdateConnectorProfile
updateConnectorProfile_connectionMode = (UpdateConnectorProfile -> ConnectionMode)
-> (UpdateConnectorProfile
-> ConnectionMode -> UpdateConnectorProfile)
-> Lens
UpdateConnectorProfile
UpdateConnectorProfile
ConnectionMode
ConnectionMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectorProfile' {ConnectionMode
connectionMode :: ConnectionMode
$sel:connectionMode:UpdateConnectorProfile' :: UpdateConnectorProfile -> ConnectionMode
connectionMode} -> ConnectionMode
connectionMode) (\s :: UpdateConnectorProfile
s@UpdateConnectorProfile' {} ConnectionMode
a -> UpdateConnectorProfile
s {$sel:connectionMode:UpdateConnectorProfile' :: ConnectionMode
connectionMode = ConnectionMode
a} :: UpdateConnectorProfile)
updateConnectorProfile_connectorProfileConfig :: Lens.Lens' UpdateConnectorProfile ConnectorProfileConfig
updateConnectorProfile_connectorProfileConfig :: (ConnectorProfileConfig -> f ConnectorProfileConfig)
-> UpdateConnectorProfile -> f UpdateConnectorProfile
updateConnectorProfile_connectorProfileConfig = (UpdateConnectorProfile -> ConnectorProfileConfig)
-> (UpdateConnectorProfile
-> ConnectorProfileConfig -> UpdateConnectorProfile)
-> Lens
UpdateConnectorProfile
UpdateConnectorProfile
ConnectorProfileConfig
ConnectorProfileConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectorProfile' {ConnectorProfileConfig
connectorProfileConfig :: ConnectorProfileConfig
$sel:connectorProfileConfig:UpdateConnectorProfile' :: UpdateConnectorProfile -> ConnectorProfileConfig
connectorProfileConfig} -> ConnectorProfileConfig
connectorProfileConfig) (\s :: UpdateConnectorProfile
s@UpdateConnectorProfile' {} ConnectorProfileConfig
a -> UpdateConnectorProfile
s {$sel:connectorProfileConfig:UpdateConnectorProfile' :: ConnectorProfileConfig
connectorProfileConfig = ConnectorProfileConfig
a} :: UpdateConnectorProfile)
instance Core.AWSRequest UpdateConnectorProfile where
type
AWSResponse UpdateConnectorProfile =
UpdateConnectorProfileResponse
request :: UpdateConnectorProfile -> Request UpdateConnectorProfile
request = Service -> UpdateConnectorProfile -> Request UpdateConnectorProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateConnectorProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateConnectorProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateConnectorProfile))
-> Logger
-> Service
-> Proxy UpdateConnectorProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateConnectorProfile)))
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 -> UpdateConnectorProfileResponse
UpdateConnectorProfileResponse'
(Maybe Text -> Int -> UpdateConnectorProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateConnectorProfileResponse)
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 -> UpdateConnectorProfileResponse)
-> Either String Int
-> Either String UpdateConnectorProfileResponse
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 UpdateConnectorProfile
instance Prelude.NFData UpdateConnectorProfile
instance Core.ToHeaders UpdateConnectorProfile where
toHeaders :: UpdateConnectorProfile -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateConnectorProfile -> 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 UpdateConnectorProfile where
toJSON :: UpdateConnectorProfile -> Value
toJSON UpdateConnectorProfile' {Text
ConnectionMode
ConnectorProfileConfig
connectorProfileConfig :: ConnectorProfileConfig
connectionMode :: ConnectionMode
connectorProfileName :: Text
$sel:connectorProfileConfig:UpdateConnectorProfile' :: UpdateConnectorProfile -> ConnectorProfileConfig
$sel:connectionMode:UpdateConnectorProfile' :: UpdateConnectorProfile -> ConnectionMode
$sel:connectorProfileName:UpdateConnectorProfile' :: UpdateConnectorProfile -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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
"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 UpdateConnectorProfile where
toPath :: UpdateConnectorProfile -> ByteString
toPath = ByteString -> UpdateConnectorProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/update-connector-profile"
instance Core.ToQuery UpdateConnectorProfile where
toQuery :: UpdateConnectorProfile -> QueryString
toQuery = QueryString -> UpdateConnectorProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateConnectorProfileResponse = UpdateConnectorProfileResponse'
{
UpdateConnectorProfileResponse -> Maybe Text
connectorProfileArn :: Prelude.Maybe Prelude.Text,
UpdateConnectorProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool
(UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool)
-> (UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool)
-> Eq UpdateConnectorProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool
$c/= :: UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool
== :: UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool
$c== :: UpdateConnectorProfileResponse
-> UpdateConnectorProfileResponse -> Bool
Prelude.Eq, ReadPrec [UpdateConnectorProfileResponse]
ReadPrec UpdateConnectorProfileResponse
Int -> ReadS UpdateConnectorProfileResponse
ReadS [UpdateConnectorProfileResponse]
(Int -> ReadS UpdateConnectorProfileResponse)
-> ReadS [UpdateConnectorProfileResponse]
-> ReadPrec UpdateConnectorProfileResponse
-> ReadPrec [UpdateConnectorProfileResponse]
-> Read UpdateConnectorProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConnectorProfileResponse]
$creadListPrec :: ReadPrec [UpdateConnectorProfileResponse]
readPrec :: ReadPrec UpdateConnectorProfileResponse
$creadPrec :: ReadPrec UpdateConnectorProfileResponse
readList :: ReadS [UpdateConnectorProfileResponse]
$creadList :: ReadS [UpdateConnectorProfileResponse]
readsPrec :: Int -> ReadS UpdateConnectorProfileResponse
$creadsPrec :: Int -> ReadS UpdateConnectorProfileResponse
Prelude.Read, Int -> UpdateConnectorProfileResponse -> ShowS
[UpdateConnectorProfileResponse] -> ShowS
UpdateConnectorProfileResponse -> String
(Int -> UpdateConnectorProfileResponse -> ShowS)
-> (UpdateConnectorProfileResponse -> String)
-> ([UpdateConnectorProfileResponse] -> ShowS)
-> Show UpdateConnectorProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConnectorProfileResponse] -> ShowS
$cshowList :: [UpdateConnectorProfileResponse] -> ShowS
show :: UpdateConnectorProfileResponse -> String
$cshow :: UpdateConnectorProfileResponse -> String
showsPrec :: Int -> UpdateConnectorProfileResponse -> ShowS
$cshowsPrec :: Int -> UpdateConnectorProfileResponse -> ShowS
Prelude.Show, (forall x.
UpdateConnectorProfileResponse
-> Rep UpdateConnectorProfileResponse x)
-> (forall x.
Rep UpdateConnectorProfileResponse x
-> UpdateConnectorProfileResponse)
-> Generic UpdateConnectorProfileResponse
forall x.
Rep UpdateConnectorProfileResponse x
-> UpdateConnectorProfileResponse
forall x.
UpdateConnectorProfileResponse
-> Rep UpdateConnectorProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConnectorProfileResponse x
-> UpdateConnectorProfileResponse
$cfrom :: forall x.
UpdateConnectorProfileResponse
-> Rep UpdateConnectorProfileResponse x
Prelude.Generic)
newUpdateConnectorProfileResponse ::
Prelude.Int ->
UpdateConnectorProfileResponse
newUpdateConnectorProfileResponse :: Int -> UpdateConnectorProfileResponse
newUpdateConnectorProfileResponse Int
pHttpStatus_ =
UpdateConnectorProfileResponse' :: Maybe Text -> Int -> UpdateConnectorProfileResponse
UpdateConnectorProfileResponse'
{ $sel:connectorProfileArn:UpdateConnectorProfileResponse' :: Maybe Text
connectorProfileArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateConnectorProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateConnectorProfileResponse_connectorProfileArn :: Lens.Lens' UpdateConnectorProfileResponse (Prelude.Maybe Prelude.Text)
updateConnectorProfileResponse_connectorProfileArn :: (Maybe Text -> f (Maybe Text))
-> UpdateConnectorProfileResponse
-> f UpdateConnectorProfileResponse
updateConnectorProfileResponse_connectorProfileArn = (UpdateConnectorProfileResponse -> Maybe Text)
-> (UpdateConnectorProfileResponse
-> Maybe Text -> UpdateConnectorProfileResponse)
-> Lens
UpdateConnectorProfileResponse
UpdateConnectorProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectorProfileResponse' {Maybe Text
connectorProfileArn :: Maybe Text
$sel:connectorProfileArn:UpdateConnectorProfileResponse' :: UpdateConnectorProfileResponse -> Maybe Text
connectorProfileArn} -> Maybe Text
connectorProfileArn) (\s :: UpdateConnectorProfileResponse
s@UpdateConnectorProfileResponse' {} Maybe Text
a -> UpdateConnectorProfileResponse
s {$sel:connectorProfileArn:UpdateConnectorProfileResponse' :: Maybe Text
connectorProfileArn = Maybe Text
a} :: UpdateConnectorProfileResponse)
updateConnectorProfileResponse_httpStatus :: Lens.Lens' UpdateConnectorProfileResponse Prelude.Int
updateConnectorProfileResponse_httpStatus :: (Int -> f Int)
-> UpdateConnectorProfileResponse
-> f UpdateConnectorProfileResponse
updateConnectorProfileResponse_httpStatus = (UpdateConnectorProfileResponse -> Int)
-> (UpdateConnectorProfileResponse
-> Int -> UpdateConnectorProfileResponse)
-> Lens
UpdateConnectorProfileResponse
UpdateConnectorProfileResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConnectorProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateConnectorProfileResponse' :: UpdateConnectorProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateConnectorProfileResponse
s@UpdateConnectorProfileResponse' {} Int
a -> UpdateConnectorProfileResponse
s {$sel:httpStatus:UpdateConnectorProfileResponse' :: Int
httpStatus = Int
a} :: UpdateConnectorProfileResponse)
instance
Prelude.NFData
UpdateConnectorProfileResponse