{-# 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.PinpointSmsVoiceV2.DeleteTextMessageSpendLimitOverride
-- 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 an account-level monthly spending limit override for sending
-- text messages. Deleting a spend limit override will set the
-- @EnforcedLimit@ to equal the @MaxLimit@, which is controlled by Amazon
-- Web Services. For more information on spend limits (quotas) see
-- <https://docs.aws.amazon.com/pinpoint/latest/developerguide/quotas.html Amazon Pinpoint quotas>
-- in the /Amazon Pinpoint Developer Guide/.
module Amazonka.PinpointSmsVoiceV2.DeleteTextMessageSpendLimitOverride
  ( -- * Creating a Request
    DeleteTextMessageSpendLimitOverride (..),
    newDeleteTextMessageSpendLimitOverride,

    -- * Destructuring the Response
    DeleteTextMessageSpendLimitOverrideResponse (..),
    newDeleteTextMessageSpendLimitOverrideResponse,

    -- * Response Lenses
    deleteTextMessageSpendLimitOverrideResponse_monthlyLimit,
    deleteTextMessageSpendLimitOverrideResponse_httpStatus,
  )
where

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

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

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

instance
  Core.AWSRequest
    DeleteTextMessageSpendLimitOverride
  where
  type
    AWSResponse DeleteTextMessageSpendLimitOverride =
      DeleteTextMessageSpendLimitOverrideResponse
  request :: (Service -> Service)
-> DeleteTextMessageSpendLimitOverride
-> Request DeleteTextMessageSpendLimitOverride
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 DeleteTextMessageSpendLimitOverride
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteTextMessageSpendLimitOverride)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Natural -> Int -> DeleteTextMessageSpendLimitOverrideResponse
DeleteTextMessageSpendLimitOverrideResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"MonthlyLimit")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DeleteTextMessageSpendLimitOverride
  where
  hashWithSalt :: Int -> DeleteTextMessageSpendLimitOverride -> Int
hashWithSalt Int
_salt DeleteTextMessageSpendLimitOverride
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

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

instance
  Data.ToHeaders
    DeleteTextMessageSpendLimitOverride
  where
  toHeaders :: DeleteTextMessageSpendLimitOverride -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"PinpointSMSVoiceV2.DeleteTextMessageSpendLimitOverride" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    DeleteTextMessageSpendLimitOverride
  where
  toJSON :: DeleteTextMessageSpendLimitOverride -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)

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

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

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

-- |
-- Create a value of 'DeleteTextMessageSpendLimitOverrideResponse' 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:
--
-- 'monthlyLimit', 'deleteTextMessageSpendLimitOverrideResponse_monthlyLimit' - The current monthly limit, in US dollars.
--
-- 'httpStatus', 'deleteTextMessageSpendLimitOverrideResponse_httpStatus' - The response's http status code.
newDeleteTextMessageSpendLimitOverrideResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteTextMessageSpendLimitOverrideResponse
newDeleteTextMessageSpendLimitOverrideResponse :: Int -> DeleteTextMessageSpendLimitOverrideResponse
newDeleteTextMessageSpendLimitOverrideResponse
  Int
pHttpStatus_ =
    DeleteTextMessageSpendLimitOverrideResponse'
      { $sel:monthlyLimit:DeleteTextMessageSpendLimitOverrideResponse' :: Maybe Natural
monthlyLimit =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DeleteTextMessageSpendLimitOverrideResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The current monthly limit, in US dollars.
deleteTextMessageSpendLimitOverrideResponse_monthlyLimit :: Lens.Lens' DeleteTextMessageSpendLimitOverrideResponse (Prelude.Maybe Prelude.Natural)
deleteTextMessageSpendLimitOverrideResponse_monthlyLimit :: Lens' DeleteTextMessageSpendLimitOverrideResponse (Maybe Natural)
deleteTextMessageSpendLimitOverrideResponse_monthlyLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTextMessageSpendLimitOverrideResponse' {Maybe Natural
monthlyLimit :: Maybe Natural
$sel:monthlyLimit:DeleteTextMessageSpendLimitOverrideResponse' :: DeleteTextMessageSpendLimitOverrideResponse -> Maybe Natural
monthlyLimit} -> Maybe Natural
monthlyLimit) (\s :: DeleteTextMessageSpendLimitOverrideResponse
s@DeleteTextMessageSpendLimitOverrideResponse' {} Maybe Natural
a -> DeleteTextMessageSpendLimitOverrideResponse
s {$sel:monthlyLimit:DeleteTextMessageSpendLimitOverrideResponse' :: Maybe Natural
monthlyLimit = Maybe Natural
a} :: DeleteTextMessageSpendLimitOverrideResponse)

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

instance
  Prelude.NFData
    DeleteTextMessageSpendLimitOverrideResponse
  where
  rnf :: DeleteTextMessageSpendLimitOverrideResponse -> ()
rnf DeleteTextMessageSpendLimitOverrideResponse' {Int
Maybe Natural
httpStatus :: Int
monthlyLimit :: Maybe Natural
$sel:httpStatus:DeleteTextMessageSpendLimitOverrideResponse' :: DeleteTextMessageSpendLimitOverrideResponse -> Int
$sel:monthlyLimit:DeleteTextMessageSpendLimitOverrideResponse' :: DeleteTextMessageSpendLimitOverrideResponse -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
monthlyLimit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus