{-# 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.DeviceFarm.DeleteVPCEConfiguration
-- 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 a configuration for your Amazon Virtual Private Cloud (VPC)
-- endpoint.
module Amazonka.DeviceFarm.DeleteVPCEConfiguration
  ( -- * Creating a Request
    DeleteVPCEConfiguration (..),
    newDeleteVPCEConfiguration,

    -- * Request Lenses
    deleteVPCEConfiguration_arn,

    -- * Destructuring the Response
    DeleteVPCEConfigurationResponse (..),
    newDeleteVPCEConfigurationResponse,

    -- * Response Lenses
    deleteVPCEConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteVPCEConfiguration' smart constructor.
data DeleteVPCEConfiguration = DeleteVPCEConfiguration'
  { -- | The Amazon Resource Name (ARN) of the VPC endpoint configuration you
    -- want to delete.
    DeleteVPCEConfiguration -> Text
arn :: Prelude.Text
  }
  deriving (DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool
$c/= :: DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool
== :: DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool
$c== :: DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteVPCEConfiguration]
ReadPrec DeleteVPCEConfiguration
Int -> ReadS DeleteVPCEConfiguration
ReadS [DeleteVPCEConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVPCEConfiguration]
$creadListPrec :: ReadPrec [DeleteVPCEConfiguration]
readPrec :: ReadPrec DeleteVPCEConfiguration
$creadPrec :: ReadPrec DeleteVPCEConfiguration
readList :: ReadS [DeleteVPCEConfiguration]
$creadList :: ReadS [DeleteVPCEConfiguration]
readsPrec :: Int -> ReadS DeleteVPCEConfiguration
$creadsPrec :: Int -> ReadS DeleteVPCEConfiguration
Prelude.Read, Int -> DeleteVPCEConfiguration -> ShowS
[DeleteVPCEConfiguration] -> ShowS
DeleteVPCEConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVPCEConfiguration] -> ShowS
$cshowList :: [DeleteVPCEConfiguration] -> ShowS
show :: DeleteVPCEConfiguration -> String
$cshow :: DeleteVPCEConfiguration -> String
showsPrec :: Int -> DeleteVPCEConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteVPCEConfiguration -> ShowS
Prelude.Show, forall x. Rep DeleteVPCEConfiguration x -> DeleteVPCEConfiguration
forall x. DeleteVPCEConfiguration -> Rep DeleteVPCEConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVPCEConfiguration x -> DeleteVPCEConfiguration
$cfrom :: forall x. DeleteVPCEConfiguration -> Rep DeleteVPCEConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVPCEConfiguration' 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:
--
-- 'arn', 'deleteVPCEConfiguration_arn' - The Amazon Resource Name (ARN) of the VPC endpoint configuration you
-- want to delete.
newDeleteVPCEConfiguration ::
  -- | 'arn'
  Prelude.Text ->
  DeleteVPCEConfiguration
newDeleteVPCEConfiguration :: Text -> DeleteVPCEConfiguration
newDeleteVPCEConfiguration Text
pArn_ =
  DeleteVPCEConfiguration' {$sel:arn:DeleteVPCEConfiguration' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the VPC endpoint configuration you
-- want to delete.
deleteVPCEConfiguration_arn :: Lens.Lens' DeleteVPCEConfiguration Prelude.Text
deleteVPCEConfiguration_arn :: Lens' DeleteVPCEConfiguration Text
deleteVPCEConfiguration_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVPCEConfiguration' {Text
arn :: Text
$sel:arn:DeleteVPCEConfiguration' :: DeleteVPCEConfiguration -> Text
arn} -> Text
arn) (\s :: DeleteVPCEConfiguration
s@DeleteVPCEConfiguration' {} Text
a -> DeleteVPCEConfiguration
s {$sel:arn:DeleteVPCEConfiguration' :: Text
arn = Text
a} :: DeleteVPCEConfiguration)

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

instance Prelude.Hashable DeleteVPCEConfiguration where
  hashWithSalt :: Int -> DeleteVPCEConfiguration -> Int
hashWithSalt Int
_salt DeleteVPCEConfiguration' {Text
arn :: Text
$sel:arn:DeleteVPCEConfiguration' :: DeleteVPCEConfiguration -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn

instance Prelude.NFData DeleteVPCEConfiguration where
  rnf :: DeleteVPCEConfiguration -> ()
rnf DeleteVPCEConfiguration' {Text
arn :: Text
$sel:arn:DeleteVPCEConfiguration' :: DeleteVPCEConfiguration -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn

instance Data.ToHeaders DeleteVPCEConfiguration where
  toHeaders :: DeleteVPCEConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DeviceFarm_20150623.DeleteVPCEConfiguration" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteVPCEConfiguration where
  toJSON :: DeleteVPCEConfiguration -> Value
toJSON DeleteVPCEConfiguration' {Text
arn :: Text
$sel:arn:DeleteVPCEConfiguration' :: DeleteVPCEConfiguration -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)]
      )

instance Data.ToPath DeleteVPCEConfiguration where
  toPath :: DeleteVPCEConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance
  Prelude.NFData
    DeleteVPCEConfigurationResponse
  where
  rnf :: DeleteVPCEConfigurationResponse -> ()
rnf DeleteVPCEConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteVPCEConfigurationResponse' :: DeleteVPCEConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus