{-# 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.DeleteMethodResponse
-- 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 MethodResponse resource.
module Amazonka.APIGateway.DeleteMethodResponse
  ( -- * Creating a Request
    DeleteMethodResponse (..),
    newDeleteMethodResponse,

    -- * Request Lenses
    deleteMethodResponse_restApiId,
    deleteMethodResponse_resourceId,
    deleteMethodResponse_httpMethod,
    deleteMethodResponse_statusCode,

    -- * Destructuring the Response
    DeleteMethodResponseResponse (..),
    newDeleteMethodResponseResponse,
  )
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

-- | A request to delete an existing MethodResponse resource.
--
-- /See:/ 'newDeleteMethodResponse' smart constructor.
data DeleteMethodResponse = DeleteMethodResponse'
  { -- | [Required] The string identifier of the associated RestApi.
    DeleteMethodResponse -> Text
restApiId :: Prelude.Text,
    -- | [Required] The Resource identifier for the MethodResponse resource.
    DeleteMethodResponse -> Text
resourceId :: Prelude.Text,
    -- | [Required] The HTTP verb of the Method resource.
    DeleteMethodResponse -> Text
httpMethod :: Prelude.Text,
    -- | [Required] The status code identifier for the MethodResponse resource.
    DeleteMethodResponse -> Text
statusCode :: Prelude.Text
  }
  deriving (DeleteMethodResponse -> DeleteMethodResponse -> Bool
(DeleteMethodResponse -> DeleteMethodResponse -> Bool)
-> (DeleteMethodResponse -> DeleteMethodResponse -> Bool)
-> Eq DeleteMethodResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMethodResponse -> DeleteMethodResponse -> Bool
$c/= :: DeleteMethodResponse -> DeleteMethodResponse -> Bool
== :: DeleteMethodResponse -> DeleteMethodResponse -> Bool
$c== :: DeleteMethodResponse -> DeleteMethodResponse -> Bool
Prelude.Eq, ReadPrec [DeleteMethodResponse]
ReadPrec DeleteMethodResponse
Int -> ReadS DeleteMethodResponse
ReadS [DeleteMethodResponse]
(Int -> ReadS DeleteMethodResponse)
-> ReadS [DeleteMethodResponse]
-> ReadPrec DeleteMethodResponse
-> ReadPrec [DeleteMethodResponse]
-> Read DeleteMethodResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMethodResponse]
$creadListPrec :: ReadPrec [DeleteMethodResponse]
readPrec :: ReadPrec DeleteMethodResponse
$creadPrec :: ReadPrec DeleteMethodResponse
readList :: ReadS [DeleteMethodResponse]
$creadList :: ReadS [DeleteMethodResponse]
readsPrec :: Int -> ReadS DeleteMethodResponse
$creadsPrec :: Int -> ReadS DeleteMethodResponse
Prelude.Read, Int -> DeleteMethodResponse -> ShowS
[DeleteMethodResponse] -> ShowS
DeleteMethodResponse -> String
(Int -> DeleteMethodResponse -> ShowS)
-> (DeleteMethodResponse -> String)
-> ([DeleteMethodResponse] -> ShowS)
-> Show DeleteMethodResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMethodResponse] -> ShowS
$cshowList :: [DeleteMethodResponse] -> ShowS
show :: DeleteMethodResponse -> String
$cshow :: DeleteMethodResponse -> String
showsPrec :: Int -> DeleteMethodResponse -> ShowS
$cshowsPrec :: Int -> DeleteMethodResponse -> ShowS
Prelude.Show, (forall x. DeleteMethodResponse -> Rep DeleteMethodResponse x)
-> (forall x. Rep DeleteMethodResponse x -> DeleteMethodResponse)
-> Generic DeleteMethodResponse
forall x. Rep DeleteMethodResponse x -> DeleteMethodResponse
forall x. DeleteMethodResponse -> Rep DeleteMethodResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMethodResponse x -> DeleteMethodResponse
$cfrom :: forall x. DeleteMethodResponse -> Rep DeleteMethodResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteMethodResponse' 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', 'deleteMethodResponse_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'resourceId', 'deleteMethodResponse_resourceId' - [Required] The Resource identifier for the MethodResponse resource.
--
-- 'httpMethod', 'deleteMethodResponse_httpMethod' - [Required] The HTTP verb of the Method resource.
--
-- 'statusCode', 'deleteMethodResponse_statusCode' - [Required] The status code identifier for the MethodResponse resource.
newDeleteMethodResponse ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'httpMethod'
  Prelude.Text ->
  -- | 'statusCode'
  Prelude.Text ->
  DeleteMethodResponse
newDeleteMethodResponse :: Text -> Text -> Text -> Text -> DeleteMethodResponse
newDeleteMethodResponse
  Text
pRestApiId_
  Text
pResourceId_
  Text
pHttpMethod_
  Text
pStatusCode_ =
    DeleteMethodResponse' :: Text -> Text -> Text -> Text -> DeleteMethodResponse
DeleteMethodResponse'
      { $sel:restApiId:DeleteMethodResponse' :: Text
restApiId = Text
pRestApiId_,
        $sel:resourceId:DeleteMethodResponse' :: Text
resourceId = Text
pResourceId_,
        $sel:httpMethod:DeleteMethodResponse' :: Text
httpMethod = Text
pHttpMethod_,
        $sel:statusCode:DeleteMethodResponse' :: Text
statusCode = Text
pStatusCode_
      }

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

-- | [Required] The Resource identifier for the MethodResponse resource.
deleteMethodResponse_resourceId :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_resourceId :: (Text -> f Text) -> DeleteMethodResponse -> f DeleteMethodResponse
deleteMethodResponse_resourceId = (DeleteMethodResponse -> Text)
-> (DeleteMethodResponse -> Text -> DeleteMethodResponse)
-> Lens DeleteMethodResponse DeleteMethodResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMethodResponse' {Text
resourceId :: Text
$sel:resourceId:DeleteMethodResponse' :: DeleteMethodResponse -> Text
resourceId} -> Text
resourceId) (\s :: DeleteMethodResponse
s@DeleteMethodResponse' {} Text
a -> DeleteMethodResponse
s {$sel:resourceId:DeleteMethodResponse' :: Text
resourceId = Text
a} :: DeleteMethodResponse)

-- | [Required] The HTTP verb of the Method resource.
deleteMethodResponse_httpMethod :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_httpMethod :: (Text -> f Text) -> DeleteMethodResponse -> f DeleteMethodResponse
deleteMethodResponse_httpMethod = (DeleteMethodResponse -> Text)
-> (DeleteMethodResponse -> Text -> DeleteMethodResponse)
-> Lens DeleteMethodResponse DeleteMethodResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMethodResponse' {Text
httpMethod :: Text
$sel:httpMethod:DeleteMethodResponse' :: DeleteMethodResponse -> Text
httpMethod} -> Text
httpMethod) (\s :: DeleteMethodResponse
s@DeleteMethodResponse' {} Text
a -> DeleteMethodResponse
s {$sel:httpMethod:DeleteMethodResponse' :: Text
httpMethod = Text
a} :: DeleteMethodResponse)

-- | [Required] The status code identifier for the MethodResponse resource.
deleteMethodResponse_statusCode :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_statusCode :: (Text -> f Text) -> DeleteMethodResponse -> f DeleteMethodResponse
deleteMethodResponse_statusCode = (DeleteMethodResponse -> Text)
-> (DeleteMethodResponse -> Text -> DeleteMethodResponse)
-> Lens DeleteMethodResponse DeleteMethodResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMethodResponse' {Text
statusCode :: Text
$sel:statusCode:DeleteMethodResponse' :: DeleteMethodResponse -> Text
statusCode} -> Text
statusCode) (\s :: DeleteMethodResponse
s@DeleteMethodResponse' {} Text
a -> DeleteMethodResponse
s {$sel:statusCode:DeleteMethodResponse' :: Text
statusCode = Text
a} :: DeleteMethodResponse)

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

instance Prelude.Hashable DeleteMethodResponse

instance Prelude.NFData DeleteMethodResponse

instance Core.ToHeaders DeleteMethodResponse where
  toHeaders :: DeleteMethodResponse -> [Header]
toHeaders =
    [Header] -> DeleteMethodResponse -> [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 DeleteMethodResponse where
  toPath :: DeleteMethodResponse -> ByteString
toPath DeleteMethodResponse' {Text
statusCode :: Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
$sel:statusCode:DeleteMethodResponse' :: DeleteMethodResponse -> Text
$sel:httpMethod:DeleteMethodResponse' :: DeleteMethodResponse -> Text
$sel:resourceId:DeleteMethodResponse' :: DeleteMethodResponse -> Text
$sel:restApiId:DeleteMethodResponse' :: DeleteMethodResponse -> 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
"/resources/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
resourceId,
        ByteString
"/methods/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
httpMethod,
        ByteString
"/responses/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
statusCode
      ]

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

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

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

instance Prelude.NFData DeleteMethodResponseResponse