{-# 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.ApiGatewayV2.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)
--
-- Deletes an Integration.
module Amazonka.ApiGatewayV2.DeleteIntegration
  ( -- * Creating a Request
    DeleteIntegration (..),
    newDeleteIntegration,

    -- * Request Lenses
    deleteIntegration_apiId,
    deleteIntegration_integrationId,

    -- * Destructuring the Response
    DeleteIntegrationResponse' (..),
    newDeleteIntegrationResponse',
  )
where

import Amazonka.ApiGatewayV2.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

-- | /See:/ 'newDeleteIntegration' smart constructor.
data DeleteIntegration = DeleteIntegration'
  { -- | The API identifier.
    DeleteIntegration -> Text
apiId :: Prelude.Text,
    -- | The integration ID.
    DeleteIntegration -> Text
integrationId :: 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:
--
-- 'apiId', 'deleteIntegration_apiId' - The API identifier.
--
-- 'integrationId', 'deleteIntegration_integrationId' - The integration ID.
newDeleteIntegration ::
  -- | 'apiId'
  Prelude.Text ->
  -- | 'integrationId'
  Prelude.Text ->
  DeleteIntegration
newDeleteIntegration :: Text -> Text -> DeleteIntegration
newDeleteIntegration Text
pApiId_ Text
pIntegrationId_ =
  DeleteIntegration' :: Text -> Text -> DeleteIntegration
DeleteIntegration'
    { $sel:apiId:DeleteIntegration' :: Text
apiId = Text
pApiId_,
      $sel:integrationId:DeleteIntegration' :: Text
integrationId = Text
pIntegrationId_
    }

-- | The API identifier.
deleteIntegration_apiId :: Lens.Lens' DeleteIntegration Prelude.Text
deleteIntegration_apiId :: (Text -> f Text) -> DeleteIntegration -> f DeleteIntegration
deleteIntegration_apiId = (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
apiId :: Text
$sel:apiId:DeleteIntegration' :: DeleteIntegration -> Text
apiId} -> Text
apiId) (\s :: DeleteIntegration
s@DeleteIntegration' {} Text
a -> DeleteIntegration
s {$sel:apiId:DeleteIntegration' :: Text
apiId = Text
a} :: DeleteIntegration)

-- | The integration ID.
deleteIntegration_integrationId :: Lens.Lens' DeleteIntegration Prelude.Text
deleteIntegration_integrationId :: (Text -> f Text) -> DeleteIntegration -> f DeleteIntegration
deleteIntegration_integrationId = (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
integrationId :: Text
$sel:integrationId:DeleteIntegration' :: DeleteIntegration -> Text
integrationId} -> Text
integrationId) (\s :: DeleteIntegration
s@DeleteIntegration' {} Text
a -> DeleteIntegration
s {$sel:integrationId:DeleteIntegration' :: Text
integrationId = 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
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteIntegration where
  toPath :: DeleteIntegration -> ByteString
toPath DeleteIntegration' {Text
integrationId :: Text
apiId :: Text
$sel:integrationId:DeleteIntegration' :: DeleteIntegration -> Text
$sel:apiId:DeleteIntegration' :: DeleteIntegration -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/apis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
        ByteString
"/integrations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
integrationId
      ]

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'