{-# 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.APIGateway.DeleteGatewayResponse
-- 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)
--
-- Clears any customization of a GatewayResponse of a specified response
-- type on the given RestApi and resets it with the default settings.
module Amazonka.APIGateway.DeleteGatewayResponse
  ( -- * Creating a Request
    DeleteGatewayResponse (..),
    newDeleteGatewayResponse,

    -- * Request Lenses
    deleteGatewayResponse_restApiId,
    deleteGatewayResponse_responseType,

    -- * Destructuring the Response
    DeleteGatewayResponseResponse (..),
    newDeleteGatewayResponseResponse,
  )
where

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

-- | Clears any customization of a GatewayResponse of a specified response
-- type on the given RestApi and resets it with the default settings.
--
-- /See:/ 'newDeleteGatewayResponse' smart constructor.
data DeleteGatewayResponse = DeleteGatewayResponse'
  { -- | [Required] The string identifier of the associated RestApi.
    DeleteGatewayResponse -> Text
restApiId :: Prelude.Text,
    -- | [Required]
    --
    -- The response type of the associated GatewayResponse.
    DeleteGatewayResponse -> GatewayResponseType
responseType :: GatewayResponseType
  }
  deriving (DeleteGatewayResponse -> DeleteGatewayResponse -> Bool
(DeleteGatewayResponse -> DeleteGatewayResponse -> Bool)
-> (DeleteGatewayResponse -> DeleteGatewayResponse -> Bool)
-> Eq DeleteGatewayResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteGatewayResponse -> DeleteGatewayResponse -> Bool
$c/= :: DeleteGatewayResponse -> DeleteGatewayResponse -> Bool
== :: DeleteGatewayResponse -> DeleteGatewayResponse -> Bool
$c== :: DeleteGatewayResponse -> DeleteGatewayResponse -> Bool
Prelude.Eq, ReadPrec [DeleteGatewayResponse]
ReadPrec DeleteGatewayResponse
Int -> ReadS DeleteGatewayResponse
ReadS [DeleteGatewayResponse]
(Int -> ReadS DeleteGatewayResponse)
-> ReadS [DeleteGatewayResponse]
-> ReadPrec DeleteGatewayResponse
-> ReadPrec [DeleteGatewayResponse]
-> Read DeleteGatewayResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteGatewayResponse]
$creadListPrec :: ReadPrec [DeleteGatewayResponse]
readPrec :: ReadPrec DeleteGatewayResponse
$creadPrec :: ReadPrec DeleteGatewayResponse
readList :: ReadS [DeleteGatewayResponse]
$creadList :: ReadS [DeleteGatewayResponse]
readsPrec :: Int -> ReadS DeleteGatewayResponse
$creadsPrec :: Int -> ReadS DeleteGatewayResponse
Prelude.Read, Int -> DeleteGatewayResponse -> ShowS
[DeleteGatewayResponse] -> ShowS
DeleteGatewayResponse -> String
(Int -> DeleteGatewayResponse -> ShowS)
-> (DeleteGatewayResponse -> String)
-> ([DeleteGatewayResponse] -> ShowS)
-> Show DeleteGatewayResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteGatewayResponse] -> ShowS
$cshowList :: [DeleteGatewayResponse] -> ShowS
show :: DeleteGatewayResponse -> String
$cshow :: DeleteGatewayResponse -> String
showsPrec :: Int -> DeleteGatewayResponse -> ShowS
$cshowsPrec :: Int -> DeleteGatewayResponse -> ShowS
Prelude.Show, (forall x. DeleteGatewayResponse -> Rep DeleteGatewayResponse x)
-> (forall x. Rep DeleteGatewayResponse x -> DeleteGatewayResponse)
-> Generic DeleteGatewayResponse
forall x. Rep DeleteGatewayResponse x -> DeleteGatewayResponse
forall x. DeleteGatewayResponse -> Rep DeleteGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteGatewayResponse x -> DeleteGatewayResponse
$cfrom :: forall x. DeleteGatewayResponse -> Rep DeleteGatewayResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteGatewayResponse' 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:
--
-- 'restApiId', 'deleteGatewayResponse_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'responseType', 'deleteGatewayResponse_responseType' - [Required]
--
-- The response type of the associated GatewayResponse.
newDeleteGatewayResponse ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'responseType'
  GatewayResponseType ->
  DeleteGatewayResponse
newDeleteGatewayResponse :: Text -> GatewayResponseType -> DeleteGatewayResponse
newDeleteGatewayResponse Text
pRestApiId_ GatewayResponseType
pResponseType_ =
  DeleteGatewayResponse' :: Text -> GatewayResponseType -> DeleteGatewayResponse
DeleteGatewayResponse'
    { $sel:restApiId:DeleteGatewayResponse' :: Text
restApiId = Text
pRestApiId_,
      $sel:responseType:DeleteGatewayResponse' :: GatewayResponseType
responseType = GatewayResponseType
pResponseType_
    }

-- | [Required] The string identifier of the associated RestApi.
deleteGatewayResponse_restApiId :: Lens.Lens' DeleteGatewayResponse Prelude.Text
deleteGatewayResponse_restApiId :: (Text -> f Text)
-> DeleteGatewayResponse -> f DeleteGatewayResponse
deleteGatewayResponse_restApiId = (DeleteGatewayResponse -> Text)
-> (DeleteGatewayResponse -> Text -> DeleteGatewayResponse)
-> Lens DeleteGatewayResponse DeleteGatewayResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGatewayResponse' {Text
restApiId :: Text
$sel:restApiId:DeleteGatewayResponse' :: DeleteGatewayResponse -> Text
restApiId} -> Text
restApiId) (\s :: DeleteGatewayResponse
s@DeleteGatewayResponse' {} Text
a -> DeleteGatewayResponse
s {$sel:restApiId:DeleteGatewayResponse' :: Text
restApiId = Text
a} :: DeleteGatewayResponse)

-- | [Required]
--
-- The response type of the associated GatewayResponse.
deleteGatewayResponse_responseType :: Lens.Lens' DeleteGatewayResponse GatewayResponseType
deleteGatewayResponse_responseType :: (GatewayResponseType -> f GatewayResponseType)
-> DeleteGatewayResponse -> f DeleteGatewayResponse
deleteGatewayResponse_responseType = (DeleteGatewayResponse -> GatewayResponseType)
-> (DeleteGatewayResponse
    -> GatewayResponseType -> DeleteGatewayResponse)
-> Lens
     DeleteGatewayResponse
     DeleteGatewayResponse
     GatewayResponseType
     GatewayResponseType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteGatewayResponse' {GatewayResponseType
responseType :: GatewayResponseType
$sel:responseType:DeleteGatewayResponse' :: DeleteGatewayResponse -> GatewayResponseType
responseType} -> GatewayResponseType
responseType) (\s :: DeleteGatewayResponse
s@DeleteGatewayResponse' {} GatewayResponseType
a -> DeleteGatewayResponse
s {$sel:responseType:DeleteGatewayResponse' :: GatewayResponseType
responseType = GatewayResponseType
a} :: DeleteGatewayResponse)

instance Core.AWSRequest DeleteGatewayResponse where
  type
    AWSResponse DeleteGatewayResponse =
      DeleteGatewayResponseResponse
  request :: DeleteGatewayResponse -> Request DeleteGatewayResponse
request = Service -> DeleteGatewayResponse -> Request DeleteGatewayResponse
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteGatewayResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGatewayResponse)))
response =
    AWSResponse DeleteGatewayResponse
-> Logger
-> Service
-> Proxy DeleteGatewayResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteGatewayResponse)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteGatewayResponse
DeleteGatewayResponseResponse
DeleteGatewayResponseResponse'

instance Prelude.Hashable DeleteGatewayResponse

instance Prelude.NFData DeleteGatewayResponse

instance Core.ToHeaders DeleteGatewayResponse where
  toHeaders :: DeleteGatewayResponse -> [Header]
toHeaders =
    [Header] -> DeleteGatewayResponse -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath DeleteGatewayResponse where
  toPath :: DeleteGatewayResponse -> ByteString
toPath DeleteGatewayResponse' {Text
GatewayResponseType
responseType :: GatewayResponseType
restApiId :: Text
$sel:responseType:DeleteGatewayResponse' :: DeleteGatewayResponse -> GatewayResponseType
$sel:restApiId:DeleteGatewayResponse' :: DeleteGatewayResponse -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/gatewayresponses/",
        GatewayResponseType -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS GatewayResponseType
responseType
      ]

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

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

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

instance Prelude.NFData DeleteGatewayResponseResponse