{-# 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.ChimeSdkVoice.DeletePhoneNumber
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- -- | Undocumented operation.
module Amazonka.ChimeSdkVoice.DeletePhoneNumber
  ( -- * Creating a Request
    DeletePhoneNumber (..),
    newDeletePhoneNumber,

    -- * Request Lenses
    deletePhoneNumber_phoneNumberId,

    -- * Destructuring the Response
    DeletePhoneNumberResponse (..),
    newDeletePhoneNumberResponse,
  )
where

import Amazonka.ChimeSdkVoice.Types
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

-- | /See:/ 'newDeletePhoneNumber' smart constructor.
data DeletePhoneNumber = DeletePhoneNumber'
  { DeletePhoneNumber -> Sensitive Text
phoneNumberId :: Data.Sensitive Prelude.Text
  }
  deriving (DeletePhoneNumber -> DeletePhoneNumber -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletePhoneNumber -> DeletePhoneNumber -> Bool
$c/= :: DeletePhoneNumber -> DeletePhoneNumber -> Bool
== :: DeletePhoneNumber -> DeletePhoneNumber -> Bool
$c== :: DeletePhoneNumber -> DeletePhoneNumber -> Bool
Prelude.Eq, Int -> DeletePhoneNumber -> ShowS
[DeletePhoneNumber] -> ShowS
DeletePhoneNumber -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletePhoneNumber] -> ShowS
$cshowList :: [DeletePhoneNumber] -> ShowS
show :: DeletePhoneNumber -> String
$cshow :: DeletePhoneNumber -> String
showsPrec :: Int -> DeletePhoneNumber -> ShowS
$cshowsPrec :: Int -> DeletePhoneNumber -> ShowS
Prelude.Show, forall x. Rep DeletePhoneNumber x -> DeletePhoneNumber
forall x. DeletePhoneNumber -> Rep DeletePhoneNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletePhoneNumber x -> DeletePhoneNumber
$cfrom :: forall x. DeletePhoneNumber -> Rep DeletePhoneNumber x
Prelude.Generic)

-- |
-- Create a value of 'DeletePhoneNumber' 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:
--
-- 'phoneNumberId', 'deletePhoneNumber_phoneNumberId' - Undocumented member.
newDeletePhoneNumber ::
  -- | 'phoneNumberId'
  Prelude.Text ->
  DeletePhoneNumber
newDeletePhoneNumber :: Text -> DeletePhoneNumber
newDeletePhoneNumber Text
pPhoneNumberId_ =
  DeletePhoneNumber'
    { $sel:phoneNumberId:DeletePhoneNumber' :: Sensitive Text
phoneNumberId =
        forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPhoneNumberId_
    }

-- | Undocumented member.
deletePhoneNumber_phoneNumberId :: Lens.Lens' DeletePhoneNumber Prelude.Text
deletePhoneNumber_phoneNumberId :: Lens' DeletePhoneNumber Text
deletePhoneNumber_phoneNumberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletePhoneNumber' {Sensitive Text
phoneNumberId :: Sensitive Text
$sel:phoneNumberId:DeletePhoneNumber' :: DeletePhoneNumber -> Sensitive Text
phoneNumberId} -> Sensitive Text
phoneNumberId) (\s :: DeletePhoneNumber
s@DeletePhoneNumber' {} Sensitive Text
a -> DeletePhoneNumber
s {$sel:phoneNumberId:DeletePhoneNumber' :: Sensitive Text
phoneNumberId = Sensitive Text
a} :: DeletePhoneNumber) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

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

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

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

instance Data.ToHeaders DeletePhoneNumber where
  toHeaders :: DeletePhoneNumber -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeletePhoneNumber where
  toPath :: DeletePhoneNumber -> ByteString
toPath DeletePhoneNumber' {Sensitive Text
phoneNumberId :: Sensitive Text
$sel:phoneNumberId:DeletePhoneNumber' :: DeletePhoneNumber -> Sensitive Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/phone-numbers/", forall a. ToByteString a => a -> ByteString
Data.toBS Sensitive Text
phoneNumberId]

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

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

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

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