{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KafkaConnect.Types
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
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]
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
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. 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'
{ $sel:currentVersion:DeleteConnector' :: Maybe Text
currentVersion = forall a. Maybe a
Prelude.Nothing,
$sel:connectorArn:DeleteConnector' :: Text
connectorArn = Text
pConnectorArn_
}
deleteConnector_currentVersion :: Lens.Lens' DeleteConnector (Prelude.Maybe Prelude.Text)
deleteConnector_currentVersion :: Lens' DeleteConnector (Maybe Text)
deleteConnector_currentVersion = 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 :: Lens' DeleteConnector Text
deleteConnector_connectorArn = 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 :: (Service -> Service) -> DeleteConnector -> Request DeleteConnector
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteConnector
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteConnector)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"connectorArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"connectorState")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteConnector where
hashWithSalt :: Int -> DeleteConnector -> Int
hashWithSalt Int
_salt DeleteConnector' {Maybe Text
Text
connectorArn :: Text
currentVersion :: Maybe Text
$sel:connectorArn:DeleteConnector' :: DeleteConnector -> Text
$sel:currentVersion:DeleteConnector' :: DeleteConnector -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
currentVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectorArn
instance Prelude.NFData DeleteConnector where
rnf :: DeleteConnector -> ()
rnf DeleteConnector' {Maybe Text
Text
connectorArn :: Text
currentVersion :: Maybe Text
$sel:connectorArn:DeleteConnector' :: DeleteConnector -> Text
$sel:currentVersion:DeleteConnector' :: DeleteConnector -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
currentVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectorArn
instance Data.ToHeaders DeleteConnector where
toHeaders :: DeleteConnector -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/connectors/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
connectorArn]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"currentVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
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]
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
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. 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'
{ $sel:connectorArn:DeleteConnectorResponse' :: Maybe Text
connectorArn =
forall a. Maybe a
Prelude.Nothing,
$sel:connectorState:DeleteConnectorResponse' :: Maybe ConnectorState
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 :: Lens' DeleteConnectorResponse (Maybe Text)
deleteConnectorResponse_connectorArn = 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 :: Lens' DeleteConnectorResponse (Maybe ConnectorState)
deleteConnectorResponse_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 :: Lens' DeleteConnectorResponse Int
deleteConnectorResponse_httpStatus = 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 where
rnf :: DeleteConnectorResponse -> ()
rnf DeleteConnectorResponse' {Int
Maybe Text
Maybe ConnectorState
httpStatus :: Int
connectorState :: Maybe ConnectorState
connectorArn :: Maybe Text
$sel:httpStatus:DeleteConnectorResponse' :: DeleteConnectorResponse -> Int
$sel:connectorState:DeleteConnectorResponse' :: DeleteConnectorResponse -> Maybe ConnectorState
$sel:connectorArn:DeleteConnectorResponse' :: DeleteConnectorResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectorArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectorState
connectorState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus