{-# 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.PinpointSMSVoice.DeleteConfigurationSet
-- 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 existing configuration set.
module Amazonka.PinpointSMSVoice.DeleteConfigurationSet
  ( -- * Creating a Request
    DeleteConfigurationSet (..),
    newDeleteConfigurationSet,

    -- * Request Lenses
    deleteConfigurationSet_configurationSetName,

    -- * Destructuring the Response
    DeleteConfigurationSetResponse (..),
    newDeleteConfigurationSetResponse,

    -- * Response Lenses
    deleteConfigurationSetResponse_httpStatus,
  )
where

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

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

-- |
-- Create a value of 'DeleteConfigurationSet' 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:
--
-- 'configurationSetName', 'deleteConfigurationSet_configurationSetName' - ConfigurationSetName
newDeleteConfigurationSet ::
  -- | 'configurationSetName'
  Prelude.Text ->
  DeleteConfigurationSet
newDeleteConfigurationSet :: Text -> DeleteConfigurationSet
newDeleteConfigurationSet Text
pConfigurationSetName_ =
  DeleteConfigurationSet' :: Text -> DeleteConfigurationSet
DeleteConfigurationSet'
    { $sel:configurationSetName:DeleteConfigurationSet' :: Text
configurationSetName =
        Text
pConfigurationSetName_
    }

-- | ConfigurationSetName
deleteConfigurationSet_configurationSetName :: Lens.Lens' DeleteConfigurationSet Prelude.Text
deleteConfigurationSet_configurationSetName :: (Text -> f Text)
-> DeleteConfigurationSet -> f DeleteConfigurationSet
deleteConfigurationSet_configurationSetName = (DeleteConfigurationSet -> Text)
-> (DeleteConfigurationSet -> Text -> DeleteConfigurationSet)
-> Lens DeleteConfigurationSet DeleteConfigurationSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteConfigurationSet' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSet' :: DeleteConfigurationSet -> Text
configurationSetName} -> Text
configurationSetName) (\s :: DeleteConfigurationSet
s@DeleteConfigurationSet' {} Text
a -> DeleteConfigurationSet
s {$sel:configurationSetName:DeleteConfigurationSet' :: Text
configurationSetName = Text
a} :: DeleteConfigurationSet)

instance Core.AWSRequest DeleteConfigurationSet where
  type
    AWSResponse DeleteConfigurationSet =
      DeleteConfigurationSetResponse
  request :: DeleteConfigurationSet -> Request DeleteConfigurationSet
request = Service -> DeleteConfigurationSet -> Request DeleteConfigurationSet
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteConfigurationSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationSet)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteConfigurationSet))
-> Logger
-> Service
-> Proxy DeleteConfigurationSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteConfigurationSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteConfigurationSetResponse
DeleteConfigurationSetResponse'
            (Int -> DeleteConfigurationSetResponse)
-> Either String Int
-> Either String DeleteConfigurationSetResponse
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 DeleteConfigurationSet

instance Prelude.NFData DeleteConfigurationSet

instance Core.ToHeaders DeleteConfigurationSet where
  toHeaders :: DeleteConfigurationSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteConfigurationSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteConfigurationSet where
  toPath :: DeleteConfigurationSet -> ByteString
toPath DeleteConfigurationSet' {Text
configurationSetName :: Text
$sel:configurationSetName:DeleteConfigurationSet' :: DeleteConfigurationSet -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v1/sms-voice/configuration-sets/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configurationSetName
      ]

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

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

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

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

instance
  Prelude.NFData
    DeleteConfigurationSetResponse