{-# 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.DeleteIntegration
-- 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)
--
-- Represents a delete integration.
module Amazonka.APIGateway.DeleteIntegration
  ( -- * Creating a Request
    DeleteIntegration (..),
    newDeleteIntegration,

    -- * Request Lenses
    deleteIntegration_restApiId,
    deleteIntegration_resourceId,
    deleteIntegration_httpMethod,

    -- * Destructuring the Response
    DeleteIntegrationResponse' (..),
    newDeleteIntegrationResponse',
  )
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

-- | Represents a delete integration request.
--
-- /See:/ 'newDeleteIntegration' smart constructor.
data DeleteIntegration = DeleteIntegration'
  { -- | [Required] The string identifier of the associated RestApi.
    DeleteIntegration -> Text
restApiId :: Prelude.Text,
    -- | [Required] Specifies a delete integration request\'s resource
    -- identifier.
    DeleteIntegration -> Text
resourceId :: Prelude.Text,
    -- | [Required] Specifies a delete integration request\'s HTTP method.
    DeleteIntegration -> Text
httpMethod :: Prelude.Text
  }
  deriving (DeleteIntegration -> DeleteIntegration -> Bool
(DeleteIntegration -> DeleteIntegration -> Bool)
-> (DeleteIntegration -> DeleteIntegration -> Bool)
-> Eq DeleteIntegration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteIntegration -> DeleteIntegration -> Bool
$c/= :: DeleteIntegration -> DeleteIntegration -> Bool
== :: DeleteIntegration -> DeleteIntegration -> Bool
$c== :: DeleteIntegration -> DeleteIntegration -> Bool
Prelude.Eq, ReadPrec [DeleteIntegration]
ReadPrec DeleteIntegration
Int -> ReadS DeleteIntegration
ReadS [DeleteIntegration]
(Int -> ReadS DeleteIntegration)
-> ReadS [DeleteIntegration]
-> ReadPrec DeleteIntegration
-> ReadPrec [DeleteIntegration]
-> Read DeleteIntegration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteIntegration]
$creadListPrec :: ReadPrec [DeleteIntegration]
readPrec :: ReadPrec DeleteIntegration
$creadPrec :: ReadPrec DeleteIntegration
readList :: ReadS [DeleteIntegration]
$creadList :: ReadS [DeleteIntegration]
readsPrec :: Int -> ReadS DeleteIntegration
$creadsPrec :: Int -> ReadS DeleteIntegration
Prelude.Read, Int -> DeleteIntegration -> ShowS
[DeleteIntegration] -> ShowS
DeleteIntegration -> String
(Int -> DeleteIntegration -> ShowS)
-> (DeleteIntegration -> String)
-> ([DeleteIntegration] -> ShowS)
-> Show DeleteIntegration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteIntegration] -> ShowS
$cshowList :: [DeleteIntegration] -> ShowS
show :: DeleteIntegration -> String
$cshow :: DeleteIntegration -> String
showsPrec :: Int -> DeleteIntegration -> ShowS
$cshowsPrec :: Int -> DeleteIntegration -> ShowS
Prelude.Show, (forall x. DeleteIntegration -> Rep DeleteIntegration x)
-> (forall x. Rep DeleteIntegration x -> DeleteIntegration)
-> Generic DeleteIntegration
forall x. Rep DeleteIntegration x -> DeleteIntegration
forall x. DeleteIntegration -> Rep DeleteIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteIntegration x -> DeleteIntegration
$cfrom :: forall x. DeleteIntegration -> Rep DeleteIntegration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteIntegration' 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', 'deleteIntegration_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'resourceId', 'deleteIntegration_resourceId' - [Required] Specifies a delete integration request\'s resource
-- identifier.
--
-- 'httpMethod', 'deleteIntegration_httpMethod' - [Required] Specifies a delete integration request\'s HTTP method.
newDeleteIntegration ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'httpMethod'
  Prelude.Text ->
  DeleteIntegration
newDeleteIntegration :: Text -> Text -> Text -> DeleteIntegration
newDeleteIntegration
  Text
pRestApiId_
  Text
pResourceId_
  Text
pHttpMethod_ =
    DeleteIntegration' :: Text -> Text -> Text -> DeleteIntegration
DeleteIntegration'
      { $sel:restApiId:DeleteIntegration' :: Text
restApiId = Text
pRestApiId_,
        $sel:resourceId:DeleteIntegration' :: Text
resourceId = Text
pResourceId_,
        $sel:httpMethod:DeleteIntegration' :: Text
httpMethod = Text
pHttpMethod_
      }

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

-- | [Required] Specifies a delete integration request\'s resource
-- identifier.
deleteIntegration_resourceId :: Lens.Lens' DeleteIntegration Prelude.Text
deleteIntegration_resourceId :: (Text -> f Text) -> DeleteIntegration -> f DeleteIntegration
deleteIntegration_resourceId = (DeleteIntegration -> Text)
-> (DeleteIntegration -> Text -> DeleteIntegration)
-> Lens DeleteIntegration DeleteIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIntegration' {Text
resourceId :: Text
$sel:resourceId:DeleteIntegration' :: DeleteIntegration -> Text
resourceId} -> Text
resourceId) (\s :: DeleteIntegration
s@DeleteIntegration' {} Text
a -> DeleteIntegration
s {$sel:resourceId:DeleteIntegration' :: Text
resourceId = Text
a} :: DeleteIntegration)

-- | [Required] Specifies a delete integration request\'s HTTP method.
deleteIntegration_httpMethod :: Lens.Lens' DeleteIntegration Prelude.Text
deleteIntegration_httpMethod :: (Text -> f Text) -> DeleteIntegration -> f DeleteIntegration
deleteIntegration_httpMethod = (DeleteIntegration -> Text)
-> (DeleteIntegration -> Text -> DeleteIntegration)
-> Lens DeleteIntegration DeleteIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteIntegration' {Text
httpMethod :: Text
$sel:httpMethod:DeleteIntegration' :: DeleteIntegration -> Text
httpMethod} -> Text
httpMethod) (\s :: DeleteIntegration
s@DeleteIntegration' {} Text
a -> DeleteIntegration
s {$sel:httpMethod:DeleteIntegration' :: Text
httpMethod = Text
a} :: DeleteIntegration)

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

instance Prelude.Hashable DeleteIntegration

instance Prelude.NFData DeleteIntegration

instance Core.ToHeaders DeleteIntegration where
  toHeaders :: DeleteIntegration -> [Header]
toHeaders =
    [Header] -> DeleteIntegration -> [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 DeleteIntegration where
  toPath :: DeleteIntegration -> ByteString
toPath DeleteIntegration' {Text
httpMethod :: Text
resourceId :: Text
restApiId :: Text
$sel:httpMethod:DeleteIntegration' :: DeleteIntegration -> Text
$sel:resourceId:DeleteIntegration' :: DeleteIntegration -> Text
$sel:restApiId:DeleteIntegration' :: DeleteIntegration -> 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
"/integration"
      ]

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

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

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

instance Prelude.NFData DeleteIntegrationResponse'