{-# 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.DeleteProfile
-- 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 profile that\'s specified in the @ProfileId@ parameter.
module Amazonka.Transfer.DeleteProfile
  ( -- * Creating a Request
    DeleteProfile (..),
    newDeleteProfile,

    -- * Request Lenses
    deleteProfile_profileId,

    -- * Destructuring the Response
    DeleteProfileResponse (..),
    newDeleteProfileResponse,
  )
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:/ 'newDeleteProfile' smart constructor.
data DeleteProfile = DeleteProfile'
  { -- | The identifier of the profile that you are deleting.
    DeleteProfile -> Text
profileId :: Prelude.Text
  }
  deriving (DeleteProfile -> DeleteProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProfile -> DeleteProfile -> Bool
$c/= :: DeleteProfile -> DeleteProfile -> Bool
== :: DeleteProfile -> DeleteProfile -> Bool
$c== :: DeleteProfile -> DeleteProfile -> Bool
Prelude.Eq, ReadPrec [DeleteProfile]
ReadPrec DeleteProfile
Int -> ReadS DeleteProfile
ReadS [DeleteProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProfile]
$creadListPrec :: ReadPrec [DeleteProfile]
readPrec :: ReadPrec DeleteProfile
$creadPrec :: ReadPrec DeleteProfile
readList :: ReadS [DeleteProfile]
$creadList :: ReadS [DeleteProfile]
readsPrec :: Int -> ReadS DeleteProfile
$creadsPrec :: Int -> ReadS DeleteProfile
Prelude.Read, Int -> DeleteProfile -> ShowS
[DeleteProfile] -> ShowS
DeleteProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProfile] -> ShowS
$cshowList :: [DeleteProfile] -> ShowS
show :: DeleteProfile -> String
$cshow :: DeleteProfile -> String
showsPrec :: Int -> DeleteProfile -> ShowS
$cshowsPrec :: Int -> DeleteProfile -> ShowS
Prelude.Show, forall x. Rep DeleteProfile x -> DeleteProfile
forall x. DeleteProfile -> Rep DeleteProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProfile x -> DeleteProfile
$cfrom :: forall x. DeleteProfile -> Rep DeleteProfile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteProfile' 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:
--
-- 'profileId', 'deleteProfile_profileId' - The identifier of the profile that you are deleting.
newDeleteProfile ::
  -- | 'profileId'
  Prelude.Text ->
  DeleteProfile
newDeleteProfile :: Text -> DeleteProfile
newDeleteProfile Text
pProfileId_ =
  DeleteProfile' {$sel:profileId:DeleteProfile' :: Text
profileId = Text
pProfileId_}

-- | The identifier of the profile that you are deleting.
deleteProfile_profileId :: Lens.Lens' DeleteProfile Prelude.Text
deleteProfile_profileId :: Lens' DeleteProfile Text
deleteProfile_profileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteProfile' {Text
profileId :: Text
$sel:profileId:DeleteProfile' :: DeleteProfile -> Text
profileId} -> Text
profileId) (\s :: DeleteProfile
s@DeleteProfile' {} Text
a -> DeleteProfile
s {$sel:profileId:DeleteProfile' :: Text
profileId = Text
a} :: DeleteProfile)

instance Core.AWSRequest DeleteProfile where
  type
    AWSResponse DeleteProfile =
      DeleteProfileResponse
  request :: (Service -> Service) -> DeleteProfile -> Request DeleteProfile
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 DeleteProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteProfile)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteProfileResponse
DeleteProfileResponse'

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

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

instance Data.ToHeaders DeleteProfile where
  toHeaders :: DeleteProfile -> [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.DeleteProfile" ::
                          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 DeleteProfile where
  toJSON :: DeleteProfile -> Value
toJSON DeleteProfile' {Text
profileId :: Text
$sel:profileId:DeleteProfile' :: DeleteProfile -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ProfileId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
profileId)]
      )

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

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

-- | /See:/ 'newDeleteProfileResponse' smart constructor.
data DeleteProfileResponse = DeleteProfileResponse'
  {
  }
  deriving (DeleteProfileResponse -> DeleteProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteProfileResponse -> DeleteProfileResponse -> Bool
$c/= :: DeleteProfileResponse -> DeleteProfileResponse -> Bool
== :: DeleteProfileResponse -> DeleteProfileResponse -> Bool
$c== :: DeleteProfileResponse -> DeleteProfileResponse -> Bool
Prelude.Eq, ReadPrec [DeleteProfileResponse]
ReadPrec DeleteProfileResponse
Int -> ReadS DeleteProfileResponse
ReadS [DeleteProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteProfileResponse]
$creadListPrec :: ReadPrec [DeleteProfileResponse]
readPrec :: ReadPrec DeleteProfileResponse
$creadPrec :: ReadPrec DeleteProfileResponse
readList :: ReadS [DeleteProfileResponse]
$creadList :: ReadS [DeleteProfileResponse]
readsPrec :: Int -> ReadS DeleteProfileResponse
$creadsPrec :: Int -> ReadS DeleteProfileResponse
Prelude.Read, Int -> DeleteProfileResponse -> ShowS
[DeleteProfileResponse] -> ShowS
DeleteProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteProfileResponse] -> ShowS
$cshowList :: [DeleteProfileResponse] -> ShowS
show :: DeleteProfileResponse -> String
$cshow :: DeleteProfileResponse -> String
showsPrec :: Int -> DeleteProfileResponse -> ShowS
$cshowsPrec :: Int -> DeleteProfileResponse -> ShowS
Prelude.Show, forall x. Rep DeleteProfileResponse x -> DeleteProfileResponse
forall x. DeleteProfileResponse -> Rep DeleteProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteProfileResponse x -> DeleteProfileResponse
$cfrom :: forall x. DeleteProfileResponse -> Rep DeleteProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteProfileResponse' 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.
newDeleteProfileResponse ::
  DeleteProfileResponse
newDeleteProfileResponse :: DeleteProfileResponse
newDeleteProfileResponse = DeleteProfileResponse
DeleteProfileResponse'

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