{-# 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.Outposts.DeleteOutpost
-- 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 the specified Outpost.
module Amazonka.Outposts.DeleteOutpost
  ( -- * Creating a Request
    DeleteOutpost (..),
    newDeleteOutpost,

    -- * Request Lenses
    deleteOutpost_outpostId,

    -- * Destructuring the Response
    DeleteOutpostResponse (..),
    newDeleteOutpostResponse,

    -- * Response Lenses
    deleteOutpostResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteOutpost' smart constructor.
data DeleteOutpost = DeleteOutpost'
  { -- | The ID or the Amazon Resource Name (ARN) of the Outpost.
    DeleteOutpost -> Text
outpostId :: Prelude.Text
  }
  deriving (DeleteOutpost -> DeleteOutpost -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOutpost -> DeleteOutpost -> Bool
$c/= :: DeleteOutpost -> DeleteOutpost -> Bool
== :: DeleteOutpost -> DeleteOutpost -> Bool
$c== :: DeleteOutpost -> DeleteOutpost -> Bool
Prelude.Eq, ReadPrec [DeleteOutpost]
ReadPrec DeleteOutpost
Int -> ReadS DeleteOutpost
ReadS [DeleteOutpost]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOutpost]
$creadListPrec :: ReadPrec [DeleteOutpost]
readPrec :: ReadPrec DeleteOutpost
$creadPrec :: ReadPrec DeleteOutpost
readList :: ReadS [DeleteOutpost]
$creadList :: ReadS [DeleteOutpost]
readsPrec :: Int -> ReadS DeleteOutpost
$creadsPrec :: Int -> ReadS DeleteOutpost
Prelude.Read, Int -> DeleteOutpost -> ShowS
[DeleteOutpost] -> ShowS
DeleteOutpost -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOutpost] -> ShowS
$cshowList :: [DeleteOutpost] -> ShowS
show :: DeleteOutpost -> String
$cshow :: DeleteOutpost -> String
showsPrec :: Int -> DeleteOutpost -> ShowS
$cshowsPrec :: Int -> DeleteOutpost -> ShowS
Prelude.Show, forall x. Rep DeleteOutpost x -> DeleteOutpost
forall x. DeleteOutpost -> Rep DeleteOutpost x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteOutpost x -> DeleteOutpost
$cfrom :: forall x. DeleteOutpost -> Rep DeleteOutpost x
Prelude.Generic)

-- |
-- Create a value of 'DeleteOutpost' 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:
--
-- 'outpostId', 'deleteOutpost_outpostId' - The ID or the Amazon Resource Name (ARN) of the Outpost.
newDeleteOutpost ::
  -- | 'outpostId'
  Prelude.Text ->
  DeleteOutpost
newDeleteOutpost :: Text -> DeleteOutpost
newDeleteOutpost Text
pOutpostId_ =
  DeleteOutpost' {$sel:outpostId:DeleteOutpost' :: Text
outpostId = Text
pOutpostId_}

-- | The ID or the Amazon Resource Name (ARN) of the Outpost.
deleteOutpost_outpostId :: Lens.Lens' DeleteOutpost Prelude.Text
deleteOutpost_outpostId :: Lens' DeleteOutpost Text
deleteOutpost_outpostId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOutpost' {Text
outpostId :: Text
$sel:outpostId:DeleteOutpost' :: DeleteOutpost -> Text
outpostId} -> Text
outpostId) (\s :: DeleteOutpost
s@DeleteOutpost' {} Text
a -> DeleteOutpost
s {$sel:outpostId:DeleteOutpost' :: Text
outpostId = Text
a} :: DeleteOutpost)

instance Core.AWSRequest DeleteOutpost where
  type
    AWSResponse DeleteOutpost =
      DeleteOutpostResponse
  request :: (Service -> Service) -> DeleteOutpost -> Request DeleteOutpost
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteOutpost
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteOutpost)))
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 -> DeleteOutpostResponse
DeleteOutpostResponse'
            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 DeleteOutpost where
  hashWithSalt :: Int -> DeleteOutpost -> Int
hashWithSalt Int
_salt DeleteOutpost' {Text
outpostId :: Text
$sel:outpostId:DeleteOutpost' :: DeleteOutpost -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
outpostId

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

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

instance Data.ToPath DeleteOutpost where
  toPath :: DeleteOutpost -> ByteString
toPath DeleteOutpost' {Text
outpostId :: Text
$sel:outpostId:DeleteOutpost' :: DeleteOutpost -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/outposts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
outpostId]

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

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

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

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

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