{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Transfer.DeleteConnector
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the agreement that\'s specified in the provided @ConnectorId@.
module Amazonka.Transfer.DeleteConnector
  ( -- * Creating a Request
    DeleteConnector (..),
    newDeleteConnector,

    -- * Request Lenses
    deleteConnector_connectorId,

    -- * Destructuring the Response
    DeleteConnectorResponse (..),
    newDeleteConnectorResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types

-- | /See:/ 'newDeleteConnector' smart constructor.
data DeleteConnector = DeleteConnector'
  { -- | The unique identifier for the connector.
    DeleteConnector -> Text
connectorId :: 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)

-- |
-- Create a value of 'DeleteConnector' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'connectorId', 'deleteConnector_connectorId' - The unique identifier for the connector.
newDeleteConnector ::
  -- | 'connectorId'
  Prelude.Text ->
  DeleteConnector
newDeleteConnector :: Text -> DeleteConnector
newDeleteConnector Text
pConnectorId_ =
  DeleteConnector' {$sel:connectorId:DeleteConnector' :: Text
connectorId = Text
pConnectorId_}

-- | The unique identifier for the connector.
deleteConnector_connectorId :: Lens.Lens' DeleteConnector Prelude.Text
deleteConnector_connectorId :: Lens' DeleteConnector Text
deleteConnector_connectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConnector' {Text
connectorId :: Text
$sel:connectorId:DeleteConnector' :: DeleteConnector -> Text
connectorId} -> Text
connectorId) (\s :: DeleteConnector
s@DeleteConnector' {} Text
a -> DeleteConnector
s {$sel:connectorId:DeleteConnector' :: Text
connectorId = 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, ToJSON a) => Service -> a -> Request a
Request.postJSON (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 =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteConnectorResponse
DeleteConnectorResponse'

instance Prelude.Hashable DeleteConnector where
  hashWithSalt :: Int -> DeleteConnector -> Int
hashWithSalt Int
_salt DeleteConnector' {Text
connectorId :: Text
$sel:connectorId:DeleteConnector' :: DeleteConnector -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectorId

instance Prelude.NFData DeleteConnector where
  rnf :: DeleteConnector -> ()
rnf DeleteConnector' {Text
connectorId :: Text
$sel:connectorId:DeleteConnector' :: DeleteConnector -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
connectorId

instance Data.ToHeaders DeleteConnector where
  toHeaders :: DeleteConnector -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"TransferService.DeleteConnector" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteConnector where
  toJSON :: DeleteConnector -> Value
toJSON DeleteConnector' {Text
connectorId :: Text
$sel:connectorId:DeleteConnector' :: DeleteConnector -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ConnectorId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
connectorId)]
      )

instance Data.ToPath DeleteConnector where
  toPath :: DeleteConnector -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DeleteConnector where
  toQuery :: DeleteConnector -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDeleteConnectorResponse' smart constructor.
data DeleteConnectorResponse = DeleteConnectorResponse'
  {
  }
  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)

-- |
-- Create a value of 'DeleteConnectorResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
newDeleteConnectorResponse ::
  DeleteConnectorResponse
newDeleteConnectorResponse :: DeleteConnectorResponse
newDeleteConnectorResponse = DeleteConnectorResponse
DeleteConnectorResponse'

instance Prelude.NFData DeleteConnectorResponse where
  rnf :: DeleteConnectorResponse -> ()
rnf DeleteConnectorResponse
_ = ()