{-# 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.SNS.DeleteSMSSandboxPhoneNumber
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes an account\'s verified or pending phone number from the SMS
-- sandbox.
--
-- When you start using Amazon SNS to send SMS messages, your account is in
-- the /SMS sandbox/. The SMS sandbox provides a safe environment for you
-- to try Amazon SNS features without risking your reputation as an SMS
-- sender. While your account is in the SMS sandbox, you can use all of the
-- features of Amazon SNS. However, you can send SMS messages only to
-- verified destination phone numbers. For more information, including how
-- to move out of the sandbox to send messages without restrictions, see
-- <https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html SMS sandbox>
-- in the /Amazon SNS Developer Guide/.
module Amazonka.SNS.DeleteSMSSandboxPhoneNumber
  ( -- * Creating a Request
    DeleteSMSSandboxPhoneNumber (..),
    newDeleteSMSSandboxPhoneNumber,

    -- * Request Lenses
    deleteSMSSandboxPhoneNumber_phoneNumber,

    -- * Destructuring the Response
    DeleteSMSSandboxPhoneNumberResponse (..),
    newDeleteSMSSandboxPhoneNumberResponse,

    -- * Response Lenses
    deleteSMSSandboxPhoneNumberResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SNS.Types

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

-- |
-- Create a value of 'DeleteSMSSandboxPhoneNumber' 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:
--
-- 'phoneNumber', 'deleteSMSSandboxPhoneNumber_phoneNumber' - The destination phone number to delete.
newDeleteSMSSandboxPhoneNumber ::
  -- | 'phoneNumber'
  Prelude.Text ->
  DeleteSMSSandboxPhoneNumber
newDeleteSMSSandboxPhoneNumber :: Text -> DeleteSMSSandboxPhoneNumber
newDeleteSMSSandboxPhoneNumber Text
pPhoneNumber_ =
  DeleteSMSSandboxPhoneNumber' :: Text -> DeleteSMSSandboxPhoneNumber
DeleteSMSSandboxPhoneNumber'
    { $sel:phoneNumber:DeleteSMSSandboxPhoneNumber' :: Text
phoneNumber =
        Text
pPhoneNumber_
    }

-- | The destination phone number to delete.
deleteSMSSandboxPhoneNumber_phoneNumber :: Lens.Lens' DeleteSMSSandboxPhoneNumber Prelude.Text
deleteSMSSandboxPhoneNumber_phoneNumber :: (Text -> f Text)
-> DeleteSMSSandboxPhoneNumber -> f DeleteSMSSandboxPhoneNumber
deleteSMSSandboxPhoneNumber_phoneNumber = (DeleteSMSSandboxPhoneNumber -> Text)
-> (DeleteSMSSandboxPhoneNumber
    -> Text -> DeleteSMSSandboxPhoneNumber)
-> Lens
     DeleteSMSSandboxPhoneNumber DeleteSMSSandboxPhoneNumber Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSMSSandboxPhoneNumber' {Text
phoneNumber :: Text
$sel:phoneNumber:DeleteSMSSandboxPhoneNumber' :: DeleteSMSSandboxPhoneNumber -> Text
phoneNumber} -> Text
phoneNumber) (\s :: DeleteSMSSandboxPhoneNumber
s@DeleteSMSSandboxPhoneNumber' {} Text
a -> DeleteSMSSandboxPhoneNumber
s {$sel:phoneNumber:DeleteSMSSandboxPhoneNumber' :: Text
phoneNumber = Text
a} :: DeleteSMSSandboxPhoneNumber)

instance Core.AWSRequest DeleteSMSSandboxPhoneNumber where
  type
    AWSResponse DeleteSMSSandboxPhoneNumber =
      DeleteSMSSandboxPhoneNumberResponse
  request :: DeleteSMSSandboxPhoneNumber -> Request DeleteSMSSandboxPhoneNumber
request = Service
-> DeleteSMSSandboxPhoneNumber
-> Request DeleteSMSSandboxPhoneNumber
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteSMSSandboxPhoneNumber
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteSMSSandboxPhoneNumber)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DeleteSMSSandboxPhoneNumber))
-> Logger
-> Service
-> Proxy DeleteSMSSandboxPhoneNumber
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteSMSSandboxPhoneNumber)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DeleteSMSSandboxPhoneNumberResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> DeleteSMSSandboxPhoneNumberResponse
DeleteSMSSandboxPhoneNumberResponse'
            (Int -> DeleteSMSSandboxPhoneNumberResponse)
-> Either String Int
-> Either String DeleteSMSSandboxPhoneNumberResponse
forall (f :: * -> *) a b. Functor 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 DeleteSMSSandboxPhoneNumber

instance Prelude.NFData DeleteSMSSandboxPhoneNumber

instance Core.ToHeaders DeleteSMSSandboxPhoneNumber where
  toHeaders :: DeleteSMSSandboxPhoneNumber -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteSMSSandboxPhoneNumber -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DeleteSMSSandboxPhoneNumber where
  toQuery :: DeleteSMSSandboxPhoneNumber -> QueryString
toQuery DeleteSMSSandboxPhoneNumber' {Text
phoneNumber :: Text
$sel:phoneNumber:DeleteSMSSandboxPhoneNumber' :: DeleteSMSSandboxPhoneNumber -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DeleteSMSSandboxPhoneNumber" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
        ByteString
"PhoneNumber" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
phoneNumber
      ]

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

-- |
-- Create a value of 'DeleteSMSSandboxPhoneNumberResponse' 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:
--
-- 'httpStatus', 'deleteSMSSandboxPhoneNumberResponse_httpStatus' - The response's http status code.
newDeleteSMSSandboxPhoneNumberResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteSMSSandboxPhoneNumberResponse
newDeleteSMSSandboxPhoneNumberResponse :: Int -> DeleteSMSSandboxPhoneNumberResponse
newDeleteSMSSandboxPhoneNumberResponse Int
pHttpStatus_ =
  DeleteSMSSandboxPhoneNumberResponse' :: Int -> DeleteSMSSandboxPhoneNumberResponse
DeleteSMSSandboxPhoneNumberResponse'
    { $sel:httpStatus:DeleteSMSSandboxPhoneNumberResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteSMSSandboxPhoneNumberResponse_httpStatus :: Lens.Lens' DeleteSMSSandboxPhoneNumberResponse Prelude.Int
deleteSMSSandboxPhoneNumberResponse_httpStatus :: (Int -> f Int)
-> DeleteSMSSandboxPhoneNumberResponse
-> f DeleteSMSSandboxPhoneNumberResponse
deleteSMSSandboxPhoneNumberResponse_httpStatus = (DeleteSMSSandboxPhoneNumberResponse -> Int)
-> (DeleteSMSSandboxPhoneNumberResponse
    -> Int -> DeleteSMSSandboxPhoneNumberResponse)
-> Lens
     DeleteSMSSandboxPhoneNumberResponse
     DeleteSMSSandboxPhoneNumberResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSMSSandboxPhoneNumberResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSMSSandboxPhoneNumberResponse' :: DeleteSMSSandboxPhoneNumberResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSMSSandboxPhoneNumberResponse
s@DeleteSMSSandboxPhoneNumberResponse' {} Int
a -> DeleteSMSSandboxPhoneNumberResponse
s {$sel:httpStatus:DeleteSMSSandboxPhoneNumberResponse' :: Int
httpStatus = Int
a} :: DeleteSMSSandboxPhoneNumberResponse)

instance
  Prelude.NFData
    DeleteSMSSandboxPhoneNumberResponse