{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | The string identifier of the associated RestApi.
    DeleteMethodResponse -> Text
restApiId :: Prelude.Text,
    -- | The Resource identifier for the MethodResponse resource.
    DeleteMethodResponse -> Text
resourceId :: Prelude.Text,
    -- | The HTTP verb of the Method resource.
    DeleteMethodResponse -> Text
httpMethod :: Prelude.Text,
    -- | The status code identifier for the MethodResponse resource.
    DeleteMethodResponse -> Text
statusCode :: Prelude.Text
  }
  deriving (DeleteMethodResponse -> DeleteMethodResponse -> Bool
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]
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
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. 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' - The string identifier of the associated RestApi.
--
-- 'resourceId', 'deleteMethodResponse_resourceId' - The Resource identifier for the MethodResponse resource.
--
-- 'httpMethod', 'deleteMethodResponse_httpMethod' - The HTTP verb of the Method resource.
--
-- 'statusCode', 'deleteMethodResponse_statusCode' - 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'
      { $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_
      }

-- | The string identifier of the associated RestApi.
deleteMethodResponse_restApiId :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_restApiId :: Lens' DeleteMethodResponse Text
deleteMethodResponse_restApiId = 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)

-- | The Resource identifier for the MethodResponse resource.
deleteMethodResponse_resourceId :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_resourceId :: Lens' DeleteMethodResponse Text
deleteMethodResponse_resourceId = 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)

-- | The HTTP verb of the Method resource.
deleteMethodResponse_httpMethod :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_httpMethod :: Lens' DeleteMethodResponse Text
deleteMethodResponse_httpMethod = 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)

-- | The status code identifier for the MethodResponse resource.
deleteMethodResponse_statusCode :: Lens.Lens' DeleteMethodResponse Prelude.Text
deleteMethodResponse_statusCode :: Lens' DeleteMethodResponse Text
deleteMethodResponse_statusCode = 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 :: (Service -> Service)
-> DeleteMethodResponse -> Request DeleteMethodResponse
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteMethodResponse
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteMethodResponse)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteMethodResponseResponse
DeleteMethodResponseResponse'

instance Prelude.Hashable DeleteMethodResponse where
  hashWithSalt :: Int -> DeleteMethodResponse -> Int
hashWithSalt Int
_salt 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
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
restApiId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
httpMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
statusCode

instance Prelude.NFData DeleteMethodResponse where
  rnf :: DeleteMethodResponse -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
restApiId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
httpMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
statusCode

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

instance Data.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
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
restApiId,
        ByteString
"/resources/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceId,
        ByteString
"/methods/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
httpMethod,
        ByteString
"/responses/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
statusCode
      ]

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

-- | /See:/ 'newDeleteMethodResponseResponse' smart constructor.
data DeleteMethodResponseResponse = DeleteMethodResponseResponse'
  {
  }
  deriving (DeleteMethodResponseResponse
-> DeleteMethodResponseResponse -> Bool
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]
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
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.
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 where
  rnf :: DeleteMethodResponseResponse -> ()
rnf DeleteMethodResponseResponse
_ = ()