{-# 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.DeleteVpcLink
-- 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 a VPC link.
module Amazonka.ApiGatewayV2.DeleteVpcLink
  ( -- * Creating a Request
    DeleteVpcLink (..),
    newDeleteVpcLink,

    -- * Request Lenses
    deleteVpcLink_vpcLinkId,

    -- * Destructuring the Response
    DeleteVpcLinkResponse (..),
    newDeleteVpcLinkResponse,

    -- * Response Lenses
    deleteVpcLinkResponse_httpStatus,
  )
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:/ 'newDeleteVpcLink' smart constructor.
data DeleteVpcLink = DeleteVpcLink'
  { -- | The ID of the VPC link.
    DeleteVpcLink -> Text
vpcLinkId :: Prelude.Text
  }
  deriving (DeleteVpcLink -> DeleteVpcLink -> Bool
(DeleteVpcLink -> DeleteVpcLink -> Bool)
-> (DeleteVpcLink -> DeleteVpcLink -> Bool) -> Eq DeleteVpcLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVpcLink -> DeleteVpcLink -> Bool
$c/= :: DeleteVpcLink -> DeleteVpcLink -> Bool
== :: DeleteVpcLink -> DeleteVpcLink -> Bool
$c== :: DeleteVpcLink -> DeleteVpcLink -> Bool
Prelude.Eq, ReadPrec [DeleteVpcLink]
ReadPrec DeleteVpcLink
Int -> ReadS DeleteVpcLink
ReadS [DeleteVpcLink]
(Int -> ReadS DeleteVpcLink)
-> ReadS [DeleteVpcLink]
-> ReadPrec DeleteVpcLink
-> ReadPrec [DeleteVpcLink]
-> Read DeleteVpcLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVpcLink]
$creadListPrec :: ReadPrec [DeleteVpcLink]
readPrec :: ReadPrec DeleteVpcLink
$creadPrec :: ReadPrec DeleteVpcLink
readList :: ReadS [DeleteVpcLink]
$creadList :: ReadS [DeleteVpcLink]
readsPrec :: Int -> ReadS DeleteVpcLink
$creadsPrec :: Int -> ReadS DeleteVpcLink
Prelude.Read, Int -> DeleteVpcLink -> ShowS
[DeleteVpcLink] -> ShowS
DeleteVpcLink -> String
(Int -> DeleteVpcLink -> ShowS)
-> (DeleteVpcLink -> String)
-> ([DeleteVpcLink] -> ShowS)
-> Show DeleteVpcLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVpcLink] -> ShowS
$cshowList :: [DeleteVpcLink] -> ShowS
show :: DeleteVpcLink -> String
$cshow :: DeleteVpcLink -> String
showsPrec :: Int -> DeleteVpcLink -> ShowS
$cshowsPrec :: Int -> DeleteVpcLink -> ShowS
Prelude.Show, (forall x. DeleteVpcLink -> Rep DeleteVpcLink x)
-> (forall x. Rep DeleteVpcLink x -> DeleteVpcLink)
-> Generic DeleteVpcLink
forall x. Rep DeleteVpcLink x -> DeleteVpcLink
forall x. DeleteVpcLink -> Rep DeleteVpcLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVpcLink x -> DeleteVpcLink
$cfrom :: forall x. DeleteVpcLink -> Rep DeleteVpcLink x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVpcLink' 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:
--
-- 'vpcLinkId', 'deleteVpcLink_vpcLinkId' - The ID of the VPC link.
newDeleteVpcLink ::
  -- | 'vpcLinkId'
  Prelude.Text ->
  DeleteVpcLink
newDeleteVpcLink :: Text -> DeleteVpcLink
newDeleteVpcLink Text
pVpcLinkId_ =
  DeleteVpcLink' :: Text -> DeleteVpcLink
DeleteVpcLink' {$sel:vpcLinkId:DeleteVpcLink' :: Text
vpcLinkId = Text
pVpcLinkId_}

-- | The ID of the VPC link.
deleteVpcLink_vpcLinkId :: Lens.Lens' DeleteVpcLink Prelude.Text
deleteVpcLink_vpcLinkId :: (Text -> f Text) -> DeleteVpcLink -> f DeleteVpcLink
deleteVpcLink_vpcLinkId = (DeleteVpcLink -> Text)
-> (DeleteVpcLink -> Text -> DeleteVpcLink)
-> Lens DeleteVpcLink DeleteVpcLink Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVpcLink' {Text
vpcLinkId :: Text
$sel:vpcLinkId:DeleteVpcLink' :: DeleteVpcLink -> Text
vpcLinkId} -> Text
vpcLinkId) (\s :: DeleteVpcLink
s@DeleteVpcLink' {} Text
a -> DeleteVpcLink
s {$sel:vpcLinkId:DeleteVpcLink' :: Text
vpcLinkId = Text
a} :: DeleteVpcLink)

instance Core.AWSRequest DeleteVpcLink where
  type
    AWSResponse DeleteVpcLink =
      DeleteVpcLinkResponse
  request :: DeleteVpcLink -> Request DeleteVpcLink
request = Service -> DeleteVpcLink -> Request DeleteVpcLink
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteVpcLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteVpcLink)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteVpcLink))
-> Logger
-> Service
-> Proxy DeleteVpcLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteVpcLink)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteVpcLinkResponse
DeleteVpcLinkResponse'
            (Int -> DeleteVpcLinkResponse)
-> Either String Int -> Either String DeleteVpcLinkResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteVpcLink

instance Prelude.NFData DeleteVpcLink

instance Core.ToHeaders DeleteVpcLink where
  toHeaders :: DeleteVpcLink -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteVpcLink -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath DeleteVpcLink where
  toPath :: DeleteVpcLink -> ByteString
toPath DeleteVpcLink' {Text
vpcLinkId :: Text
$sel:vpcLinkId:DeleteVpcLink' :: DeleteVpcLink -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v2/vpclinks/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vpcLinkId]

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

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

-- |
-- Create a value of 'DeleteVpcLinkResponse' 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:
--
-- 'httpStatus', 'deleteVpcLinkResponse_httpStatus' - The response's http status code.
newDeleteVpcLinkResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteVpcLinkResponse
newDeleteVpcLinkResponse :: Int -> DeleteVpcLinkResponse
newDeleteVpcLinkResponse Int
pHttpStatus_ =
  DeleteVpcLinkResponse' :: Int -> DeleteVpcLinkResponse
DeleteVpcLinkResponse' {$sel:httpStatus:DeleteVpcLinkResponse' :: Int
httpStatus = Int
pHttpStatus_}

-- | The response's http status code.
deleteVpcLinkResponse_httpStatus :: Lens.Lens' DeleteVpcLinkResponse Prelude.Int
deleteVpcLinkResponse_httpStatus :: (Int -> f Int) -> DeleteVpcLinkResponse -> f DeleteVpcLinkResponse
deleteVpcLinkResponse_httpStatus = (DeleteVpcLinkResponse -> Int)
-> (DeleteVpcLinkResponse -> Int -> DeleteVpcLinkResponse)
-> Lens DeleteVpcLinkResponse DeleteVpcLinkResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVpcLinkResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteVpcLinkResponse' :: DeleteVpcLinkResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteVpcLinkResponse
s@DeleteVpcLinkResponse' {} Int
a -> DeleteVpcLinkResponse
s {$sel:httpStatus:DeleteVpcLinkResponse' :: Int
httpStatus = Int
a} :: DeleteVpcLinkResponse)

instance Prelude.NFData DeleteVpcLinkResponse