{-# 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.Kinesis.DeleteStream
(
DeleteStream (..),
newDeleteStream,
deleteStream_enforceConsumerDeletion,
deleteStream_streamName,
DeleteStreamResponse (..),
newDeleteStreamResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.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 DeleteStream = DeleteStream'
{
DeleteStream -> Maybe Bool
enforceConsumerDeletion :: Prelude.Maybe Prelude.Bool,
DeleteStream -> Text
streamName :: Prelude.Text
}
deriving (DeleteStream -> DeleteStream -> Bool
(DeleteStream -> DeleteStream -> Bool)
-> (DeleteStream -> DeleteStream -> Bool) -> Eq DeleteStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStream -> DeleteStream -> Bool
$c/= :: DeleteStream -> DeleteStream -> Bool
== :: DeleteStream -> DeleteStream -> Bool
$c== :: DeleteStream -> DeleteStream -> Bool
Prelude.Eq, ReadPrec [DeleteStream]
ReadPrec DeleteStream
Int -> ReadS DeleteStream
ReadS [DeleteStream]
(Int -> ReadS DeleteStream)
-> ReadS [DeleteStream]
-> ReadPrec DeleteStream
-> ReadPrec [DeleteStream]
-> Read DeleteStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStream]
$creadListPrec :: ReadPrec [DeleteStream]
readPrec :: ReadPrec DeleteStream
$creadPrec :: ReadPrec DeleteStream
readList :: ReadS [DeleteStream]
$creadList :: ReadS [DeleteStream]
readsPrec :: Int -> ReadS DeleteStream
$creadsPrec :: Int -> ReadS DeleteStream
Prelude.Read, Int -> DeleteStream -> ShowS
[DeleteStream] -> ShowS
DeleteStream -> String
(Int -> DeleteStream -> ShowS)
-> (DeleteStream -> String)
-> ([DeleteStream] -> ShowS)
-> Show DeleteStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStream] -> ShowS
$cshowList :: [DeleteStream] -> ShowS
show :: DeleteStream -> String
$cshow :: DeleteStream -> String
showsPrec :: Int -> DeleteStream -> ShowS
$cshowsPrec :: Int -> DeleteStream -> ShowS
Prelude.Show, (forall x. DeleteStream -> Rep DeleteStream x)
-> (forall x. Rep DeleteStream x -> DeleteStream)
-> Generic DeleteStream
forall x. Rep DeleteStream x -> DeleteStream
forall x. DeleteStream -> Rep DeleteStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStream x -> DeleteStream
$cfrom :: forall x. DeleteStream -> Rep DeleteStream x
Prelude.Generic)
newDeleteStream ::
Prelude.Text ->
DeleteStream
newDeleteStream :: Text -> DeleteStream
newDeleteStream Text
pStreamName_ =
DeleteStream' :: Maybe Bool -> Text -> DeleteStream
DeleteStream'
{ $sel:enforceConsumerDeletion:DeleteStream' :: Maybe Bool
enforceConsumerDeletion =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:DeleteStream' :: Text
streamName = Text
pStreamName_
}
deleteStream_enforceConsumerDeletion :: Lens.Lens' DeleteStream (Prelude.Maybe Prelude.Bool)
deleteStream_enforceConsumerDeletion :: (Maybe Bool -> f (Maybe Bool)) -> DeleteStream -> f DeleteStream
deleteStream_enforceConsumerDeletion = (DeleteStream -> Maybe Bool)
-> (DeleteStream -> Maybe Bool -> DeleteStream)
-> Lens DeleteStream DeleteStream (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStream' {Maybe Bool
enforceConsumerDeletion :: Maybe Bool
$sel:enforceConsumerDeletion:DeleteStream' :: DeleteStream -> Maybe Bool
enforceConsumerDeletion} -> Maybe Bool
enforceConsumerDeletion) (\s :: DeleteStream
s@DeleteStream' {} Maybe Bool
a -> DeleteStream
s {$sel:enforceConsumerDeletion:DeleteStream' :: Maybe Bool
enforceConsumerDeletion = Maybe Bool
a} :: DeleteStream)
deleteStream_streamName :: Lens.Lens' DeleteStream Prelude.Text
deleteStream_streamName :: (Text -> f Text) -> DeleteStream -> f DeleteStream
deleteStream_streamName = (DeleteStream -> Text)
-> (DeleteStream -> Text -> DeleteStream)
-> Lens DeleteStream DeleteStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteStream' {Text
streamName :: Text
$sel:streamName:DeleteStream' :: DeleteStream -> Text
streamName} -> Text
streamName) (\s :: DeleteStream
s@DeleteStream' {} Text
a -> DeleteStream
s {$sel:streamName:DeleteStream' :: Text
streamName = Text
a} :: DeleteStream)
instance Core.AWSRequest DeleteStream where
type AWSResponse DeleteStream = DeleteStreamResponse
request :: DeleteStream -> Request DeleteStream
request = Service -> DeleteStream -> Request DeleteStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStream)))
response = AWSResponse DeleteStream
-> Logger
-> Service
-> Proxy DeleteStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteStream)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteStream
DeleteStreamResponse
DeleteStreamResponse'
instance Prelude.Hashable DeleteStream
instance Prelude.NFData DeleteStream
instance Core.ToHeaders DeleteStream where
toHeaders :: DeleteStream -> [Header]
toHeaders =
[Header] -> DeleteStream -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"Kinesis_20131202.DeleteStream" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteStream where
toJSON :: DeleteStream -> Value
toJSON DeleteStream' {Maybe Bool
Text
streamName :: Text
enforceConsumerDeletion :: Maybe Bool
$sel:streamName:DeleteStream' :: DeleteStream -> Text
$sel:enforceConsumerDeletion:DeleteStream' :: DeleteStream -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EnforceConsumerDeletion" 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
enforceConsumerDeletion,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName)
]
)
instance Core.ToPath DeleteStream where
toPath :: DeleteStream -> ByteString
toPath = ByteString -> DeleteStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteStream where
toQuery :: DeleteStream -> QueryString
toQuery = QueryString -> DeleteStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteStreamResponse = DeleteStreamResponse'
{
}
deriving (DeleteStreamResponse -> DeleteStreamResponse -> Bool
(DeleteStreamResponse -> DeleteStreamResponse -> Bool)
-> (DeleteStreamResponse -> DeleteStreamResponse -> Bool)
-> Eq DeleteStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
$c/= :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
== :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
$c== :: DeleteStreamResponse -> DeleteStreamResponse -> Bool
Prelude.Eq, ReadPrec [DeleteStreamResponse]
ReadPrec DeleteStreamResponse
Int -> ReadS DeleteStreamResponse
ReadS [DeleteStreamResponse]
(Int -> ReadS DeleteStreamResponse)
-> ReadS [DeleteStreamResponse]
-> ReadPrec DeleteStreamResponse
-> ReadPrec [DeleteStreamResponse]
-> Read DeleteStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteStreamResponse]
$creadListPrec :: ReadPrec [DeleteStreamResponse]
readPrec :: ReadPrec DeleteStreamResponse
$creadPrec :: ReadPrec DeleteStreamResponse
readList :: ReadS [DeleteStreamResponse]
$creadList :: ReadS [DeleteStreamResponse]
readsPrec :: Int -> ReadS DeleteStreamResponse
$creadsPrec :: Int -> ReadS DeleteStreamResponse
Prelude.Read, Int -> DeleteStreamResponse -> ShowS
[DeleteStreamResponse] -> ShowS
DeleteStreamResponse -> String
(Int -> DeleteStreamResponse -> ShowS)
-> (DeleteStreamResponse -> String)
-> ([DeleteStreamResponse] -> ShowS)
-> Show DeleteStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteStreamResponse] -> ShowS
$cshowList :: [DeleteStreamResponse] -> ShowS
show :: DeleteStreamResponse -> String
$cshow :: DeleteStreamResponse -> String
showsPrec :: Int -> DeleteStreamResponse -> ShowS
$cshowsPrec :: Int -> DeleteStreamResponse -> ShowS
Prelude.Show, (forall x. DeleteStreamResponse -> Rep DeleteStreamResponse x)
-> (forall x. Rep DeleteStreamResponse x -> DeleteStreamResponse)
-> Generic DeleteStreamResponse
forall x. Rep DeleteStreamResponse x -> DeleteStreamResponse
forall x. DeleteStreamResponse -> Rep DeleteStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteStreamResponse x -> DeleteStreamResponse
$cfrom :: forall x. DeleteStreamResponse -> Rep DeleteStreamResponse x
Prelude.Generic)
newDeleteStreamResponse ::
DeleteStreamResponse
newDeleteStreamResponse :: DeleteStreamResponse
newDeleteStreamResponse = DeleteStreamResponse
DeleteStreamResponse'
instance Prelude.NFData DeleteStreamResponse