{-# 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.ServiceQuotas.DisassociateServiceQuotaTemplate
-- 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)
--
-- Disables your quota request template. After a template is disabled, the
-- quota increase requests in the template are not applied to new accounts
-- in your organization. Disabling a quota request template does not apply
-- its quota increase requests.
module Amazonka.ServiceQuotas.DisassociateServiceQuotaTemplate
  ( -- * Creating a Request
    DisassociateServiceQuotaTemplate (..),
    newDisassociateServiceQuotaTemplate,

    -- * Destructuring the Response
    DisassociateServiceQuotaTemplateResponse (..),
    newDisassociateServiceQuotaTemplateResponse,

    -- * Response Lenses
    disassociateServiceQuotaTemplateResponse_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.ServiceQuotas.Types

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

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

instance
  Core.AWSRequest
    DisassociateServiceQuotaTemplate
  where
  type
    AWSResponse DisassociateServiceQuotaTemplate =
      DisassociateServiceQuotaTemplateResponse
  request :: DisassociateServiceQuotaTemplate
-> Request DisassociateServiceQuotaTemplate
request = Service
-> DisassociateServiceQuotaTemplate
-> Request DisassociateServiceQuotaTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateServiceQuotaTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DisassociateServiceQuotaTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DisassociateServiceQuotaTemplate))
-> Logger
-> Service
-> Proxy DisassociateServiceQuotaTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DisassociateServiceQuotaTemplate)))
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 -> DisassociateServiceQuotaTemplateResponse
DisassociateServiceQuotaTemplateResponse'
            (Int -> DisassociateServiceQuotaTemplateResponse)
-> Either String Int
-> Either String DisassociateServiceQuotaTemplateResponse
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
    DisassociateServiceQuotaTemplate

instance
  Prelude.NFData
    DisassociateServiceQuotaTemplate

instance
  Core.ToHeaders
    DisassociateServiceQuotaTemplate
  where
  toHeaders :: DisassociateServiceQuotaTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DisassociateServiceQuotaTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"ServiceQuotasV20190624.DisassociateServiceQuotaTemplate" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DisassociateServiceQuotaTemplate where
  toJSON :: DisassociateServiceQuotaTemplate -> Value
toJSON = Value -> DisassociateServiceQuotaTemplate -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

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

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

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

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

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

instance
  Prelude.NFData
    DisassociateServiceQuotaTemplateResponse