{-# 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.Firehose.DeleteDeliveryStream
(
DeleteDeliveryStream (..),
newDeleteDeliveryStream,
deleteDeliveryStream_allowForceDelete,
deleteDeliveryStream_deliveryStreamName,
DeleteDeliveryStreamResponse (..),
newDeleteDeliveryStreamResponse,
deleteDeliveryStreamResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Firehose.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
data DeleteDeliveryStream = DeleteDeliveryStream'
{
DeleteDeliveryStream -> Maybe Bool
allowForceDelete :: Prelude.Maybe Prelude.Bool,
DeleteDeliveryStream -> Text
deliveryStreamName :: Prelude.Text
}
deriving (DeleteDeliveryStream -> DeleteDeliveryStream -> Bool
(DeleteDeliveryStream -> DeleteDeliveryStream -> Bool)
-> (DeleteDeliveryStream -> DeleteDeliveryStream -> Bool)
-> Eq DeleteDeliveryStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeliveryStream -> DeleteDeliveryStream -> Bool
$c/= :: DeleteDeliveryStream -> DeleteDeliveryStream -> Bool
== :: DeleteDeliveryStream -> DeleteDeliveryStream -> Bool
$c== :: DeleteDeliveryStream -> DeleteDeliveryStream -> Bool
Prelude.Eq, ReadPrec [DeleteDeliveryStream]
ReadPrec DeleteDeliveryStream
Int -> ReadS DeleteDeliveryStream
ReadS [DeleteDeliveryStream]
(Int -> ReadS DeleteDeliveryStream)
-> ReadS [DeleteDeliveryStream]
-> ReadPrec DeleteDeliveryStream
-> ReadPrec [DeleteDeliveryStream]
-> Read DeleteDeliveryStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeliveryStream]
$creadListPrec :: ReadPrec [DeleteDeliveryStream]
readPrec :: ReadPrec DeleteDeliveryStream
$creadPrec :: ReadPrec DeleteDeliveryStream
readList :: ReadS [DeleteDeliveryStream]
$creadList :: ReadS [DeleteDeliveryStream]
readsPrec :: Int -> ReadS DeleteDeliveryStream
$creadsPrec :: Int -> ReadS DeleteDeliveryStream
Prelude.Read, Int -> DeleteDeliveryStream -> ShowS
[DeleteDeliveryStream] -> ShowS
DeleteDeliveryStream -> String
(Int -> DeleteDeliveryStream -> ShowS)
-> (DeleteDeliveryStream -> String)
-> ([DeleteDeliveryStream] -> ShowS)
-> Show DeleteDeliveryStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeliveryStream] -> ShowS
$cshowList :: [DeleteDeliveryStream] -> ShowS
show :: DeleteDeliveryStream -> String
$cshow :: DeleteDeliveryStream -> String
showsPrec :: Int -> DeleteDeliveryStream -> ShowS
$cshowsPrec :: Int -> DeleteDeliveryStream -> ShowS
Prelude.Show, (forall x. DeleteDeliveryStream -> Rep DeleteDeliveryStream x)
-> (forall x. Rep DeleteDeliveryStream x -> DeleteDeliveryStream)
-> Generic DeleteDeliveryStream
forall x. Rep DeleteDeliveryStream x -> DeleteDeliveryStream
forall x. DeleteDeliveryStream -> Rep DeleteDeliveryStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDeliveryStream x -> DeleteDeliveryStream
$cfrom :: forall x. DeleteDeliveryStream -> Rep DeleteDeliveryStream x
Prelude.Generic)
newDeleteDeliveryStream ::
Prelude.Text ->
DeleteDeliveryStream
newDeleteDeliveryStream :: Text -> DeleteDeliveryStream
newDeleteDeliveryStream Text
pDeliveryStreamName_ =
DeleteDeliveryStream' :: Maybe Bool -> Text -> DeleteDeliveryStream
DeleteDeliveryStream'
{ $sel:allowForceDelete:DeleteDeliveryStream' :: Maybe Bool
allowForceDelete =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:deliveryStreamName:DeleteDeliveryStream' :: Text
deliveryStreamName = Text
pDeliveryStreamName_
}
deleteDeliveryStream_allowForceDelete :: Lens.Lens' DeleteDeliveryStream (Prelude.Maybe Prelude.Bool)
deleteDeliveryStream_allowForceDelete :: (Maybe Bool -> f (Maybe Bool))
-> DeleteDeliveryStream -> f DeleteDeliveryStream
deleteDeliveryStream_allowForceDelete = (DeleteDeliveryStream -> Maybe Bool)
-> (DeleteDeliveryStream -> Maybe Bool -> DeleteDeliveryStream)
-> Lens
DeleteDeliveryStream DeleteDeliveryStream (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeliveryStream' {Maybe Bool
allowForceDelete :: Maybe Bool
$sel:allowForceDelete:DeleteDeliveryStream' :: DeleteDeliveryStream -> Maybe Bool
allowForceDelete} -> Maybe Bool
allowForceDelete) (\s :: DeleteDeliveryStream
s@DeleteDeliveryStream' {} Maybe Bool
a -> DeleteDeliveryStream
s {$sel:allowForceDelete:DeleteDeliveryStream' :: Maybe Bool
allowForceDelete = Maybe Bool
a} :: DeleteDeliveryStream)
deleteDeliveryStream_deliveryStreamName :: Lens.Lens' DeleteDeliveryStream Prelude.Text
deleteDeliveryStream_deliveryStreamName :: (Text -> f Text) -> DeleteDeliveryStream -> f DeleteDeliveryStream
deleteDeliveryStream_deliveryStreamName = (DeleteDeliveryStream -> Text)
-> (DeleteDeliveryStream -> Text -> DeleteDeliveryStream)
-> Lens DeleteDeliveryStream DeleteDeliveryStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeliveryStream' {Text
deliveryStreamName :: Text
$sel:deliveryStreamName:DeleteDeliveryStream' :: DeleteDeliveryStream -> Text
deliveryStreamName} -> Text
deliveryStreamName) (\s :: DeleteDeliveryStream
s@DeleteDeliveryStream' {} Text
a -> DeleteDeliveryStream
s {$sel:deliveryStreamName:DeleteDeliveryStream' :: Text
deliveryStreamName = Text
a} :: DeleteDeliveryStream)
instance Core.AWSRequest DeleteDeliveryStream where
type
AWSResponse DeleteDeliveryStream =
DeleteDeliveryStreamResponse
request :: DeleteDeliveryStream -> Request DeleteDeliveryStream
request = Service -> DeleteDeliveryStream -> Request DeleteDeliveryStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDeliveryStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeliveryStream)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteDeliveryStream))
-> Logger
-> Service
-> Proxy DeleteDeliveryStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeliveryStream)))
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 -> DeleteDeliveryStreamResponse
DeleteDeliveryStreamResponse'
(Int -> DeleteDeliveryStreamResponse)
-> Either String Int -> Either String DeleteDeliveryStreamResponse
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 DeleteDeliveryStream
instance Prelude.NFData DeleteDeliveryStream
instance Core.ToHeaders DeleteDeliveryStream where
toHeaders :: DeleteDeliveryStream -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDeliveryStream -> 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
"Firehose_20150804.DeleteDeliveryStream" ::
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 DeleteDeliveryStream where
toJSON :: DeleteDeliveryStream -> Value
toJSON DeleteDeliveryStream' {Maybe Bool
Text
deliveryStreamName :: Text
allowForceDelete :: Maybe Bool
$sel:deliveryStreamName:DeleteDeliveryStream' :: DeleteDeliveryStream -> Text
$sel:allowForceDelete:DeleteDeliveryStream' :: DeleteDeliveryStream -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AllowForceDelete" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowForceDelete,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeliveryStreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deliveryStreamName)
]
)
instance Core.ToPath DeleteDeliveryStream where
toPath :: DeleteDeliveryStream -> ByteString
toPath = ByteString -> DeleteDeliveryStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteDeliveryStream where
toQuery :: DeleteDeliveryStream -> QueryString
toQuery = QueryString -> DeleteDeliveryStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDeliveryStreamResponse = DeleteDeliveryStreamResponse'
{
DeleteDeliveryStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool
(DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool)
-> (DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool)
-> Eq DeleteDeliveryStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool
$c/= :: DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool
== :: DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool
$c== :: DeleteDeliveryStreamResponse
-> DeleteDeliveryStreamResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDeliveryStreamResponse]
ReadPrec DeleteDeliveryStreamResponse
Int -> ReadS DeleteDeliveryStreamResponse
ReadS [DeleteDeliveryStreamResponse]
(Int -> ReadS DeleteDeliveryStreamResponse)
-> ReadS [DeleteDeliveryStreamResponse]
-> ReadPrec DeleteDeliveryStreamResponse
-> ReadPrec [DeleteDeliveryStreamResponse]
-> Read DeleteDeliveryStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeliveryStreamResponse]
$creadListPrec :: ReadPrec [DeleteDeliveryStreamResponse]
readPrec :: ReadPrec DeleteDeliveryStreamResponse
$creadPrec :: ReadPrec DeleteDeliveryStreamResponse
readList :: ReadS [DeleteDeliveryStreamResponse]
$creadList :: ReadS [DeleteDeliveryStreamResponse]
readsPrec :: Int -> ReadS DeleteDeliveryStreamResponse
$creadsPrec :: Int -> ReadS DeleteDeliveryStreamResponse
Prelude.Read, Int -> DeleteDeliveryStreamResponse -> ShowS
[DeleteDeliveryStreamResponse] -> ShowS
DeleteDeliveryStreamResponse -> String
(Int -> DeleteDeliveryStreamResponse -> ShowS)
-> (DeleteDeliveryStreamResponse -> String)
-> ([DeleteDeliveryStreamResponse] -> ShowS)
-> Show DeleteDeliveryStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeliveryStreamResponse] -> ShowS
$cshowList :: [DeleteDeliveryStreamResponse] -> ShowS
show :: DeleteDeliveryStreamResponse -> String
$cshow :: DeleteDeliveryStreamResponse -> String
showsPrec :: Int -> DeleteDeliveryStreamResponse -> ShowS
$cshowsPrec :: Int -> DeleteDeliveryStreamResponse -> ShowS
Prelude.Show, (forall x.
DeleteDeliveryStreamResponse -> Rep DeleteDeliveryStreamResponse x)
-> (forall x.
Rep DeleteDeliveryStreamResponse x -> DeleteDeliveryStreamResponse)
-> Generic DeleteDeliveryStreamResponse
forall x.
Rep DeleteDeliveryStreamResponse x -> DeleteDeliveryStreamResponse
forall x.
DeleteDeliveryStreamResponse -> Rep DeleteDeliveryStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDeliveryStreamResponse x -> DeleteDeliveryStreamResponse
$cfrom :: forall x.
DeleteDeliveryStreamResponse -> Rep DeleteDeliveryStreamResponse x
Prelude.Generic)
newDeleteDeliveryStreamResponse ::
Prelude.Int ->
DeleteDeliveryStreamResponse
newDeleteDeliveryStreamResponse :: Int -> DeleteDeliveryStreamResponse
newDeleteDeliveryStreamResponse Int
pHttpStatus_ =
DeleteDeliveryStreamResponse' :: Int -> DeleteDeliveryStreamResponse
DeleteDeliveryStreamResponse'
{ $sel:httpStatus:DeleteDeliveryStreamResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteDeliveryStreamResponse_httpStatus :: Lens.Lens' DeleteDeliveryStreamResponse Prelude.Int
deleteDeliveryStreamResponse_httpStatus :: (Int -> f Int)
-> DeleteDeliveryStreamResponse -> f DeleteDeliveryStreamResponse
deleteDeliveryStreamResponse_httpStatus = (DeleteDeliveryStreamResponse -> Int)
-> (DeleteDeliveryStreamResponse
-> Int -> DeleteDeliveryStreamResponse)
-> Lens
DeleteDeliveryStreamResponse DeleteDeliveryStreamResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeliveryStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDeliveryStreamResponse' :: DeleteDeliveryStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDeliveryStreamResponse
s@DeleteDeliveryStreamResponse' {} Int
a -> DeleteDeliveryStreamResponse
s {$sel:httpStatus:DeleteDeliveryStreamResponse' :: Int
httpStatus = Int
a} :: DeleteDeliveryStreamResponse)
instance Prelude.NFData DeleteDeliveryStreamResponse