{-# 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.DeleteConnector
(
DeleteConnector (..),
newDeleteConnector,
deleteConnector_currentVersion,
deleteConnector_connectorArn,
DeleteConnectorResponse (..),
newDeleteConnectorResponse,
deleteConnectorResponse_connectorArn,
deleteConnectorResponse_connectorState,
deleteConnectorResponse_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 DeleteConnector = DeleteConnector'
{
DeleteConnector -> Maybe Text
currentVersion :: Prelude.Maybe Prelude.Text,
DeleteConnector -> Text
connectorArn :: Prelude.Text
}
deriving (DeleteConnector -> DeleteConnector -> Bool
(DeleteConnector -> DeleteConnector -> Bool)
-> (DeleteConnector -> DeleteConnector -> Bool)
-> Eq DeleteConnector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnector -> DeleteConnector -> Bool
$c/= :: DeleteConnector -> DeleteConnector -> Bool
== :: DeleteConnector -> DeleteConnector -> Bool
$c== :: DeleteConnector -> DeleteConnector -> Bool
Prelude.Eq, ReadPrec [DeleteConnector]
ReadPrec DeleteConnector
Int -> ReadS DeleteConnector
ReadS [DeleteConnector]
(Int -> ReadS DeleteConnector)
-> ReadS [DeleteConnector]
-> ReadPrec DeleteConnector
-> ReadPrec [DeleteConnector]
-> Read DeleteConnector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnector]
$creadListPrec :: ReadPrec [DeleteConnector]
readPrec :: ReadPrec DeleteConnector
$creadPrec :: ReadPrec DeleteConnector
readList :: ReadS [DeleteConnector]
$creadList :: ReadS [DeleteConnector]
readsPrec :: Int -> ReadS DeleteConnector
$creadsPrec :: Int -> ReadS DeleteConnector
Prelude.Read, Int -> DeleteConnector -> ShowS
[DeleteConnector] -> ShowS
DeleteConnector -> String
(Int -> DeleteConnector -> ShowS)
-> (DeleteConnector -> String)
-> ([DeleteConnector] -> ShowS)
-> Show DeleteConnector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnector] -> ShowS
$cshowList :: [DeleteConnector] -> ShowS
show :: DeleteConnector -> String
$cshow :: DeleteConnector -> String
showsPrec :: Int -> DeleteConnector -> ShowS
$cshowsPrec :: Int -> DeleteConnector -> ShowS
Prelude.Show, (forall x. DeleteConnector -> Rep DeleteConnector x)
-> (forall x. Rep DeleteConnector x -> DeleteConnector)
-> Generic DeleteConnector
forall x. Rep DeleteConnector x -> DeleteConnector
forall x. DeleteConnector -> Rep DeleteConnector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteConnector x -> DeleteConnector
$cfrom :: forall x. DeleteConnector -> Rep DeleteConnector x
Prelude.Generic)
newDeleteConnector ::
Prelude.Text ->
DeleteConnector
newDeleteConnector :: Text -> DeleteConnector
newDeleteConnector Text
pConnectorArn_ =
DeleteConnector' :: Maybe Text -> Text -> DeleteConnector
DeleteConnector'
{ $sel:currentVersion:DeleteConnector' :: Maybe Text
currentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectorArn:DeleteConnector' :: Text
connectorArn = Text
pConnectorArn_
}
deleteConnector_currentVersion :: Lens.Lens' DeleteConnector (Prelude.Maybe Prelude.Text)
deleteConnector_currentVersion :: (Maybe Text -> f (Maybe Text))
-> DeleteConnector -> f DeleteConnector
deleteConnector_currentVersion = (DeleteConnector -> Maybe Text)
-> (DeleteConnector -> Maybe Text -> DeleteConnector)
-> Lens DeleteConnector DeleteConnector (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnector' {Maybe Text
currentVersion :: Maybe Text
$sel:currentVersion:DeleteConnector' :: DeleteConnector -> Maybe Text
currentVersion} -> Maybe Text
currentVersion) (\s :: DeleteConnector
s@DeleteConnector' {} Maybe Text
a -> DeleteConnector
s {$sel:currentVersion:DeleteConnector' :: Maybe Text
currentVersion = Maybe Text
a} :: DeleteConnector)
deleteConnector_connectorArn :: Lens.Lens' DeleteConnector Prelude.Text
deleteConnector_connectorArn :: (Text -> f Text) -> DeleteConnector -> f DeleteConnector
deleteConnector_connectorArn = (DeleteConnector -> Text)
-> (DeleteConnector -> Text -> DeleteConnector)
-> Lens DeleteConnector DeleteConnector Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnector' {Text
connectorArn :: Text
$sel:connectorArn:DeleteConnector' :: DeleteConnector -> Text
connectorArn} -> Text
connectorArn) (\s :: DeleteConnector
s@DeleteConnector' {} Text
a -> DeleteConnector
s {$sel:connectorArn:DeleteConnector' :: Text
connectorArn = Text
a} :: DeleteConnector)
instance Core.AWSRequest DeleteConnector where
type
AWSResponse DeleteConnector =
DeleteConnectorResponse
request :: DeleteConnector -> Request DeleteConnector
request = Service -> DeleteConnector -> Request DeleteConnector
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteConnector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteConnector)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteConnector))
-> Logger
-> Service
-> Proxy DeleteConnector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteConnector)))
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 ConnectorState -> Int -> DeleteConnectorResponse
DeleteConnectorResponse'
(Maybe Text
-> Maybe ConnectorState -> Int -> DeleteConnectorResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe ConnectorState -> Int -> DeleteConnectorResponse)
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 ConnectorState -> Int -> DeleteConnectorResponse)
-> Either String (Maybe ConnectorState)
-> Either String (Int -> DeleteConnectorResponse)
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 -> DeleteConnectorResponse)
-> Either String Int -> Either String DeleteConnectorResponse
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 DeleteConnector
instance Prelude.NFData DeleteConnector
instance Core.ToHeaders DeleteConnector where
toHeaders :: DeleteConnector -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteConnector -> 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.ToPath DeleteConnector where
toPath :: DeleteConnector -> ByteString
toPath DeleteConnector' {Maybe Text
Text
connectorArn :: Text
currentVersion :: Maybe Text
$sel:connectorArn:DeleteConnector' :: DeleteConnector -> Text
$sel:currentVersion:DeleteConnector' :: DeleteConnector -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/connectors/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
connectorArn]
instance Core.ToQuery DeleteConnector where
toQuery :: DeleteConnector -> QueryString
toQuery DeleteConnector' {Maybe Text
Text
connectorArn :: Text
currentVersion :: Maybe Text
$sel:connectorArn:DeleteConnector' :: DeleteConnector -> Text
$sel:currentVersion:DeleteConnector' :: DeleteConnector -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"currentVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
currentVersion]
data DeleteConnectorResponse = DeleteConnectorResponse'
{
DeleteConnectorResponse -> Maybe Text
connectorArn :: Prelude.Maybe Prelude.Text,
DeleteConnectorResponse -> Maybe ConnectorState
connectorState :: Prelude.Maybe ConnectorState,
DeleteConnectorResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteConnectorResponse -> DeleteConnectorResponse -> Bool
(DeleteConnectorResponse -> DeleteConnectorResponse -> Bool)
-> (DeleteConnectorResponse -> DeleteConnectorResponse -> Bool)
-> Eq DeleteConnectorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteConnectorResponse -> DeleteConnectorResponse -> Bool
$c/= :: DeleteConnectorResponse -> DeleteConnectorResponse -> Bool
== :: DeleteConnectorResponse -> DeleteConnectorResponse -> Bool
$c== :: DeleteConnectorResponse -> DeleteConnectorResponse -> Bool
Prelude.Eq, ReadPrec [DeleteConnectorResponse]
ReadPrec DeleteConnectorResponse
Int -> ReadS DeleteConnectorResponse
ReadS [DeleteConnectorResponse]
(Int -> ReadS DeleteConnectorResponse)
-> ReadS [DeleteConnectorResponse]
-> ReadPrec DeleteConnectorResponse
-> ReadPrec [DeleteConnectorResponse]
-> Read DeleteConnectorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteConnectorResponse]
$creadListPrec :: ReadPrec [DeleteConnectorResponse]
readPrec :: ReadPrec DeleteConnectorResponse
$creadPrec :: ReadPrec DeleteConnectorResponse
readList :: ReadS [DeleteConnectorResponse]
$creadList :: ReadS [DeleteConnectorResponse]
readsPrec :: Int -> ReadS DeleteConnectorResponse
$creadsPrec :: Int -> ReadS DeleteConnectorResponse
Prelude.Read, Int -> DeleteConnectorResponse -> ShowS
[DeleteConnectorResponse] -> ShowS
DeleteConnectorResponse -> String
(Int -> DeleteConnectorResponse -> ShowS)
-> (DeleteConnectorResponse -> String)
-> ([DeleteConnectorResponse] -> ShowS)
-> Show DeleteConnectorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteConnectorResponse] -> ShowS
$cshowList :: [DeleteConnectorResponse] -> ShowS
show :: DeleteConnectorResponse -> String
$cshow :: DeleteConnectorResponse -> String
showsPrec :: Int -> DeleteConnectorResponse -> ShowS
$cshowsPrec :: Int -> DeleteConnectorResponse -> ShowS
Prelude.Show, (forall x.
DeleteConnectorResponse -> Rep DeleteConnectorResponse x)
-> (forall x.
Rep DeleteConnectorResponse x -> DeleteConnectorResponse)
-> Generic DeleteConnectorResponse
forall x. Rep DeleteConnectorResponse x -> DeleteConnectorResponse
forall x. DeleteConnectorResponse -> Rep DeleteConnectorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteConnectorResponse x -> DeleteConnectorResponse
$cfrom :: forall x. DeleteConnectorResponse -> Rep DeleteConnectorResponse x
Prelude.Generic)
newDeleteConnectorResponse ::
Prelude.Int ->
DeleteConnectorResponse
newDeleteConnectorResponse :: Int -> DeleteConnectorResponse
newDeleteConnectorResponse Int
pHttpStatus_ =
DeleteConnectorResponse' :: Maybe Text
-> Maybe ConnectorState -> Int -> DeleteConnectorResponse
DeleteConnectorResponse'
{ $sel:connectorArn:DeleteConnectorResponse' :: Maybe Text
connectorArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectorState:DeleteConnectorResponse' :: Maybe ConnectorState
connectorState = Maybe ConnectorState
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteConnectorResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteConnectorResponse_connectorArn :: Lens.Lens' DeleteConnectorResponse (Prelude.Maybe Prelude.Text)
deleteConnectorResponse_connectorArn :: (Maybe Text -> f (Maybe Text))
-> DeleteConnectorResponse -> f DeleteConnectorResponse
deleteConnectorResponse_connectorArn = (DeleteConnectorResponse -> Maybe Text)
-> (DeleteConnectorResponse
-> Maybe Text -> DeleteConnectorResponse)
-> Lens
DeleteConnectorResponse
DeleteConnectorResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectorResponse' {Maybe Text
connectorArn :: Maybe Text
$sel:connectorArn:DeleteConnectorResponse' :: DeleteConnectorResponse -> Maybe Text
connectorArn} -> Maybe Text
connectorArn) (\s :: DeleteConnectorResponse
s@DeleteConnectorResponse' {} Maybe Text
a -> DeleteConnectorResponse
s {$sel:connectorArn:DeleteConnectorResponse' :: Maybe Text
connectorArn = Maybe Text
a} :: DeleteConnectorResponse)
deleteConnectorResponse_connectorState :: Lens.Lens' DeleteConnectorResponse (Prelude.Maybe ConnectorState)
deleteConnectorResponse_connectorState :: (Maybe ConnectorState -> f (Maybe ConnectorState))
-> DeleteConnectorResponse -> f DeleteConnectorResponse
deleteConnectorResponse_connectorState = (DeleteConnectorResponse -> Maybe ConnectorState)
-> (DeleteConnectorResponse
-> Maybe ConnectorState -> DeleteConnectorResponse)
-> Lens
DeleteConnectorResponse
DeleteConnectorResponse
(Maybe ConnectorState)
(Maybe ConnectorState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectorResponse' {Maybe ConnectorState
connectorState :: Maybe ConnectorState
$sel:connectorState:DeleteConnectorResponse' :: DeleteConnectorResponse -> Maybe ConnectorState
connectorState} -> Maybe ConnectorState
connectorState) (\s :: DeleteConnectorResponse
s@DeleteConnectorResponse' {} Maybe ConnectorState
a -> DeleteConnectorResponse
s {$sel:connectorState:DeleteConnectorResponse' :: Maybe ConnectorState
connectorState = Maybe ConnectorState
a} :: DeleteConnectorResponse)
deleteConnectorResponse_httpStatus :: Lens.Lens' DeleteConnectorResponse Prelude.Int
deleteConnectorResponse_httpStatus :: (Int -> f Int)
-> DeleteConnectorResponse -> f DeleteConnectorResponse
deleteConnectorResponse_httpStatus = (DeleteConnectorResponse -> Int)
-> (DeleteConnectorResponse -> Int -> DeleteConnectorResponse)
-> Lens DeleteConnectorResponse DeleteConnectorResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnectorResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteConnectorResponse' :: DeleteConnectorResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteConnectorResponse
s@DeleteConnectorResponse' {} Int
a -> DeleteConnectorResponse
s {$sel:httpStatus:DeleteConnectorResponse' :: Int
httpStatus = Int
a} :: DeleteConnectorResponse)
instance Prelude.NFData DeleteConnectorResponse