{-# 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-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 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 Amazonka.DeviceFarm.Types
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:/ '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
(DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool)
-> (DeleteVPCEConfiguration -> DeleteVPCEConfiguration -> Bool)
-> Eq DeleteVPCEConfiguration
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]
(Int -> ReadS DeleteVPCEConfiguration)
-> ReadS [DeleteVPCEConfiguration]
-> ReadPrec DeleteVPCEConfiguration
-> ReadPrec [DeleteVPCEConfiguration]
-> Read 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
(Int -> DeleteVPCEConfiguration -> ShowS)
-> (DeleteVPCEConfiguration -> String)
-> ([DeleteVPCEConfiguration] -> ShowS)
-> Show DeleteVPCEConfiguration
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.
 DeleteVPCEConfiguration -> Rep DeleteVPCEConfiguration x)
-> (forall x.
    Rep DeleteVPCEConfiguration x -> DeleteVPCEConfiguration)
-> Generic DeleteVPCEConfiguration
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' :: Text -> DeleteVPCEConfiguration
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 :: (Text -> f Text)
-> DeleteVPCEConfiguration -> f DeleteVPCEConfiguration
deleteVPCEConfiguration_arn = (DeleteVPCEConfiguration -> Text)
-> (DeleteVPCEConfiguration -> Text -> DeleteVPCEConfiguration)
-> Lens DeleteVPCEConfiguration DeleteVPCEConfiguration Text Text
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 :: DeleteVPCEConfiguration -> Request DeleteVPCEConfiguration
request = Service
-> DeleteVPCEConfiguration -> Request DeleteVPCEConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteVPCEConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteVPCEConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteVPCEConfiguration))
-> Logger
-> Service
-> Proxy DeleteVPCEConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteVPCEConfiguration)))
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 -> DeleteVPCEConfigurationResponse
DeleteVPCEConfigurationResponse'
            (Int -> DeleteVPCEConfigurationResponse)
-> Either String Int
-> Either String DeleteVPCEConfigurationResponse
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 DeleteVPCEConfiguration

instance Prelude.NFData DeleteVPCEConfiguration

instance Core.ToHeaders DeleteVPCEConfiguration where
  toHeaders :: DeleteVPCEConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteVPCEConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DeviceFarm_20150623.DeleteVPCEConfiguration" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DeleteVPCEConfiguration where
  toJSON :: DeleteVPCEConfiguration -> Value
toJSON DeleteVPCEConfiguration' {Text
arn :: Text
$sel:arn:DeleteVPCEConfiguration' :: DeleteVPCEConfiguration -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)]
      )

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

instance Core.ToQuery DeleteVPCEConfiguration where
  toQuery :: DeleteVPCEConfiguration -> QueryString
toQuery = QueryString -> DeleteVPCEConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteVPCEConfigurationResponse
 -> DeleteVPCEConfigurationResponse -> Bool)
-> (DeleteVPCEConfigurationResponse
    -> DeleteVPCEConfigurationResponse -> Bool)
-> Eq DeleteVPCEConfigurationResponse
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]
(Int -> ReadS DeleteVPCEConfigurationResponse)
-> ReadS [DeleteVPCEConfigurationResponse]
-> ReadPrec DeleteVPCEConfigurationResponse
-> ReadPrec [DeleteVPCEConfigurationResponse]
-> Read 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
(Int -> DeleteVPCEConfigurationResponse -> ShowS)
-> (DeleteVPCEConfigurationResponse -> String)
-> ([DeleteVPCEConfigurationResponse] -> ShowS)
-> Show DeleteVPCEConfigurationResponse
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.
 DeleteVPCEConfigurationResponse
 -> Rep DeleteVPCEConfigurationResponse x)
-> (forall x.
    Rep DeleteVPCEConfigurationResponse x
    -> DeleteVPCEConfigurationResponse)
-> Generic DeleteVPCEConfigurationResponse
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' :: Int -> DeleteVPCEConfigurationResponse
DeleteVPCEConfigurationResponse'
    { $sel:httpStatus:DeleteVPCEConfigurationResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteVPCEConfigurationResponse_httpStatus :: Lens.Lens' DeleteVPCEConfigurationResponse Prelude.Int
deleteVPCEConfigurationResponse_httpStatus :: (Int -> f Int)
-> DeleteVPCEConfigurationResponse
-> f DeleteVPCEConfigurationResponse
deleteVPCEConfigurationResponse_httpStatus = (DeleteVPCEConfigurationResponse -> Int)
-> (DeleteVPCEConfigurationResponse
    -> Int -> DeleteVPCEConfigurationResponse)
-> Lens
     DeleteVPCEConfigurationResponse
     DeleteVPCEConfigurationResponse
     Int
     Int
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