{-# 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 #-}
module Amazonka.Outposts.DeleteOutpost
(
DeleteOutpost (..),
newDeleteOutpost,
deleteOutpost_outpostId,
DeleteOutpostResponse (..),
newDeleteOutpostResponse,
deleteOutpostResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Outposts.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteOutpost = DeleteOutpost'
{
DeleteOutpost -> Text
outpostId :: Prelude.Text
}
deriving (DeleteOutpost -> DeleteOutpost -> Bool
(DeleteOutpost -> DeleteOutpost -> Bool)
-> (DeleteOutpost -> DeleteOutpost -> Bool) -> Eq DeleteOutpost
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]
(Int -> ReadS DeleteOutpost)
-> ReadS [DeleteOutpost]
-> ReadPrec DeleteOutpost
-> ReadPrec [DeleteOutpost]
-> Read 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
(Int -> DeleteOutpost -> ShowS)
-> (DeleteOutpost -> String)
-> ([DeleteOutpost] -> ShowS)
-> Show DeleteOutpost
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. DeleteOutpost -> Rep DeleteOutpost x)
-> (forall x. Rep DeleteOutpost x -> DeleteOutpost)
-> Generic DeleteOutpost
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)
newDeleteOutpost ::
Prelude.Text ->
DeleteOutpost
newDeleteOutpost :: Text -> DeleteOutpost
newDeleteOutpost Text
pOutpostId_ =
DeleteOutpost' :: Text -> DeleteOutpost
DeleteOutpost' {$sel:outpostId:DeleteOutpost' :: Text
outpostId = Text
pOutpostId_}
deleteOutpost_outpostId :: Lens.Lens' DeleteOutpost Prelude.Text
deleteOutpost_outpostId :: (Text -> f Text) -> DeleteOutpost -> f DeleteOutpost
deleteOutpost_outpostId = (DeleteOutpost -> Text)
-> (DeleteOutpost -> Text -> DeleteOutpost)
-> Lens DeleteOutpost DeleteOutpost Text Text
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 :: DeleteOutpost -> Request DeleteOutpost
request = Service -> DeleteOutpost -> Request DeleteOutpost
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteOutpost
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteOutpost)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteOutpost))
-> Logger
-> Service
-> Proxy DeleteOutpost
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteOutpost)))
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 -> DeleteOutpostResponse
DeleteOutpostResponse'
(Int -> DeleteOutpostResponse)
-> Either String Int -> Either String DeleteOutpostResponse
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 DeleteOutpost
instance Prelude.NFData DeleteOutpost
instance Core.ToHeaders DeleteOutpost where
toHeaders :: DeleteOutpost -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteOutpost -> 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 DeleteOutpost where
toPath :: DeleteOutpost -> ByteString
toPath DeleteOutpost' {Text
outpostId :: Text
$sel:outpostId:DeleteOutpost' :: DeleteOutpost -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/outposts/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
outpostId]
instance Core.ToQuery DeleteOutpost where
toQuery :: DeleteOutpost -> QueryString
toQuery = QueryString -> DeleteOutpost -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteOutpostResponse = DeleteOutpostResponse'
{
DeleteOutpostResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteOutpostResponse -> DeleteOutpostResponse -> Bool
(DeleteOutpostResponse -> DeleteOutpostResponse -> Bool)
-> (DeleteOutpostResponse -> DeleteOutpostResponse -> Bool)
-> Eq DeleteOutpostResponse
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]
(Int -> ReadS DeleteOutpostResponse)
-> ReadS [DeleteOutpostResponse]
-> ReadPrec DeleteOutpostResponse
-> ReadPrec [DeleteOutpostResponse]
-> Read 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
(Int -> DeleteOutpostResponse -> ShowS)
-> (DeleteOutpostResponse -> String)
-> ([DeleteOutpostResponse] -> ShowS)
-> Show DeleteOutpostResponse
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. DeleteOutpostResponse -> Rep DeleteOutpostResponse x)
-> (forall x. Rep DeleteOutpostResponse x -> DeleteOutpostResponse)
-> Generic DeleteOutpostResponse
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)
newDeleteOutpostResponse ::
Prelude.Int ->
DeleteOutpostResponse
newDeleteOutpostResponse :: Int -> DeleteOutpostResponse
newDeleteOutpostResponse Int
pHttpStatus_ =
DeleteOutpostResponse' :: Int -> DeleteOutpostResponse
DeleteOutpostResponse' {$sel:httpStatus:DeleteOutpostResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteOutpostResponse_httpStatus :: Lens.Lens' DeleteOutpostResponse Prelude.Int
deleteOutpostResponse_httpStatus :: (Int -> f Int) -> DeleteOutpostResponse -> f DeleteOutpostResponse
deleteOutpostResponse_httpStatus = (DeleteOutpostResponse -> Int)
-> (DeleteOutpostResponse -> Int -> DeleteOutpostResponse)
-> Lens DeleteOutpostResponse DeleteOutpostResponse Int Int
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