{-# 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.DecreaseStreamRetentionPeriod
(
DecreaseStreamRetentionPeriod (..),
newDecreaseStreamRetentionPeriod,
decreaseStreamRetentionPeriod_streamName,
decreaseStreamRetentionPeriod_retentionPeriodHours,
DecreaseStreamRetentionPeriodResponse (..),
newDecreaseStreamRetentionPeriodResponse,
)
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 DecreaseStreamRetentionPeriod = DecreaseStreamRetentionPeriod'
{
DecreaseStreamRetentionPeriod -> Text
streamName :: Prelude.Text,
DecreaseStreamRetentionPeriod -> Int
retentionPeriodHours :: Prelude.Int
}
deriving (DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool
(DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool)
-> (DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool)
-> Eq DecreaseStreamRetentionPeriod
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool
$c/= :: DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool
== :: DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool
$c== :: DecreaseStreamRetentionPeriod
-> DecreaseStreamRetentionPeriod -> Bool
Prelude.Eq, ReadPrec [DecreaseStreamRetentionPeriod]
ReadPrec DecreaseStreamRetentionPeriod
Int -> ReadS DecreaseStreamRetentionPeriod
ReadS [DecreaseStreamRetentionPeriod]
(Int -> ReadS DecreaseStreamRetentionPeriod)
-> ReadS [DecreaseStreamRetentionPeriod]
-> ReadPrec DecreaseStreamRetentionPeriod
-> ReadPrec [DecreaseStreamRetentionPeriod]
-> Read DecreaseStreamRetentionPeriod
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecreaseStreamRetentionPeriod]
$creadListPrec :: ReadPrec [DecreaseStreamRetentionPeriod]
readPrec :: ReadPrec DecreaseStreamRetentionPeriod
$creadPrec :: ReadPrec DecreaseStreamRetentionPeriod
readList :: ReadS [DecreaseStreamRetentionPeriod]
$creadList :: ReadS [DecreaseStreamRetentionPeriod]
readsPrec :: Int -> ReadS DecreaseStreamRetentionPeriod
$creadsPrec :: Int -> ReadS DecreaseStreamRetentionPeriod
Prelude.Read, Int -> DecreaseStreamRetentionPeriod -> ShowS
[DecreaseStreamRetentionPeriod] -> ShowS
DecreaseStreamRetentionPeriod -> String
(Int -> DecreaseStreamRetentionPeriod -> ShowS)
-> (DecreaseStreamRetentionPeriod -> String)
-> ([DecreaseStreamRetentionPeriod] -> ShowS)
-> Show DecreaseStreamRetentionPeriod
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecreaseStreamRetentionPeriod] -> ShowS
$cshowList :: [DecreaseStreamRetentionPeriod] -> ShowS
show :: DecreaseStreamRetentionPeriod -> String
$cshow :: DecreaseStreamRetentionPeriod -> String
showsPrec :: Int -> DecreaseStreamRetentionPeriod -> ShowS
$cshowsPrec :: Int -> DecreaseStreamRetentionPeriod -> ShowS
Prelude.Show, (forall x.
DecreaseStreamRetentionPeriod
-> Rep DecreaseStreamRetentionPeriod x)
-> (forall x.
Rep DecreaseStreamRetentionPeriod x
-> DecreaseStreamRetentionPeriod)
-> Generic DecreaseStreamRetentionPeriod
forall x.
Rep DecreaseStreamRetentionPeriod x
-> DecreaseStreamRetentionPeriod
forall x.
DecreaseStreamRetentionPeriod
-> Rep DecreaseStreamRetentionPeriod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DecreaseStreamRetentionPeriod x
-> DecreaseStreamRetentionPeriod
$cfrom :: forall x.
DecreaseStreamRetentionPeriod
-> Rep DecreaseStreamRetentionPeriod x
Prelude.Generic)
newDecreaseStreamRetentionPeriod ::
Prelude.Text ->
Prelude.Int ->
DecreaseStreamRetentionPeriod
newDecreaseStreamRetentionPeriod :: Text -> Int -> DecreaseStreamRetentionPeriod
newDecreaseStreamRetentionPeriod
Text
pStreamName_
Int
pRetentionPeriodHours_ =
DecreaseStreamRetentionPeriod' :: Text -> Int -> DecreaseStreamRetentionPeriod
DecreaseStreamRetentionPeriod'
{ $sel:streamName:DecreaseStreamRetentionPeriod' :: Text
streamName =
Text
pStreamName_,
$sel:retentionPeriodHours:DecreaseStreamRetentionPeriod' :: Int
retentionPeriodHours =
Int
pRetentionPeriodHours_
}
decreaseStreamRetentionPeriod_streamName :: Lens.Lens' DecreaseStreamRetentionPeriod Prelude.Text
decreaseStreamRetentionPeriod_streamName :: (Text -> f Text)
-> DecreaseStreamRetentionPeriod -> f DecreaseStreamRetentionPeriod
decreaseStreamRetentionPeriod_streamName = (DecreaseStreamRetentionPeriod -> Text)
-> (DecreaseStreamRetentionPeriod
-> Text -> DecreaseStreamRetentionPeriod)
-> Lens
DecreaseStreamRetentionPeriod
DecreaseStreamRetentionPeriod
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseStreamRetentionPeriod' {Text
streamName :: Text
$sel:streamName:DecreaseStreamRetentionPeriod' :: DecreaseStreamRetentionPeriod -> Text
streamName} -> Text
streamName) (\s :: DecreaseStreamRetentionPeriod
s@DecreaseStreamRetentionPeriod' {} Text
a -> DecreaseStreamRetentionPeriod
s {$sel:streamName:DecreaseStreamRetentionPeriod' :: Text
streamName = Text
a} :: DecreaseStreamRetentionPeriod)
decreaseStreamRetentionPeriod_retentionPeriodHours :: Lens.Lens' DecreaseStreamRetentionPeriod Prelude.Int
decreaseStreamRetentionPeriod_retentionPeriodHours :: (Int -> f Int)
-> DecreaseStreamRetentionPeriod -> f DecreaseStreamRetentionPeriod
decreaseStreamRetentionPeriod_retentionPeriodHours = (DecreaseStreamRetentionPeriod -> Int)
-> (DecreaseStreamRetentionPeriod
-> Int -> DecreaseStreamRetentionPeriod)
-> Lens
DecreaseStreamRetentionPeriod DecreaseStreamRetentionPeriod Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseStreamRetentionPeriod' {Int
retentionPeriodHours :: Int
$sel:retentionPeriodHours:DecreaseStreamRetentionPeriod' :: DecreaseStreamRetentionPeriod -> Int
retentionPeriodHours} -> Int
retentionPeriodHours) (\s :: DecreaseStreamRetentionPeriod
s@DecreaseStreamRetentionPeriod' {} Int
a -> DecreaseStreamRetentionPeriod
s {$sel:retentionPeriodHours:DecreaseStreamRetentionPeriod' :: Int
retentionPeriodHours = Int
a} :: DecreaseStreamRetentionPeriod)
instance
Core.AWSRequest
DecreaseStreamRetentionPeriod
where
type
AWSResponse DecreaseStreamRetentionPeriod =
DecreaseStreamRetentionPeriodResponse
request :: DecreaseStreamRetentionPeriod
-> Request DecreaseStreamRetentionPeriod
request = Service
-> DecreaseStreamRetentionPeriod
-> Request DecreaseStreamRetentionPeriod
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DecreaseStreamRetentionPeriod
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DecreaseStreamRetentionPeriod)))
response =
AWSResponse DecreaseStreamRetentionPeriod
-> Logger
-> Service
-> Proxy DecreaseStreamRetentionPeriod
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DecreaseStreamRetentionPeriod)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse DecreaseStreamRetentionPeriod
DecreaseStreamRetentionPeriodResponse
DecreaseStreamRetentionPeriodResponse'
instance
Prelude.Hashable
DecreaseStreamRetentionPeriod
instance Prelude.NFData DecreaseStreamRetentionPeriod
instance Core.ToHeaders DecreaseStreamRetentionPeriod where
toHeaders :: DecreaseStreamRetentionPeriod -> [Header]
toHeaders =
[Header] -> DecreaseStreamRetentionPeriod -> [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.DecreaseStreamRetentionPeriod" ::
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 DecreaseStreamRetentionPeriod where
toJSON :: DecreaseStreamRetentionPeriod -> Value
toJSON DecreaseStreamRetentionPeriod' {Int
Text
retentionPeriodHours :: Int
streamName :: Text
$sel:retentionPeriodHours:DecreaseStreamRetentionPeriod' :: DecreaseStreamRetentionPeriod -> Int
$sel:streamName:DecreaseStreamRetentionPeriod' :: DecreaseStreamRetentionPeriod -> 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
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"RetentionPeriodHours"
Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
retentionPeriodHours
)
]
)
instance Core.ToPath DecreaseStreamRetentionPeriod where
toPath :: DecreaseStreamRetentionPeriod -> ByteString
toPath = ByteString -> DecreaseStreamRetentionPeriod -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DecreaseStreamRetentionPeriod where
toQuery :: DecreaseStreamRetentionPeriod -> QueryString
toQuery = QueryString -> DecreaseStreamRetentionPeriod -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DecreaseStreamRetentionPeriodResponse = DecreaseStreamRetentionPeriodResponse'
{
}
deriving (DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool
(DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool)
-> (DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool)
-> Eq DecreaseStreamRetentionPeriodResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool
$c/= :: DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool
== :: DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool
$c== :: DecreaseStreamRetentionPeriodResponse
-> DecreaseStreamRetentionPeriodResponse -> Bool
Prelude.Eq, ReadPrec [DecreaseStreamRetentionPeriodResponse]
ReadPrec DecreaseStreamRetentionPeriodResponse
Int -> ReadS DecreaseStreamRetentionPeriodResponse
ReadS [DecreaseStreamRetentionPeriodResponse]
(Int -> ReadS DecreaseStreamRetentionPeriodResponse)
-> ReadS [DecreaseStreamRetentionPeriodResponse]
-> ReadPrec DecreaseStreamRetentionPeriodResponse
-> ReadPrec [DecreaseStreamRetentionPeriodResponse]
-> Read DecreaseStreamRetentionPeriodResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecreaseStreamRetentionPeriodResponse]
$creadListPrec :: ReadPrec [DecreaseStreamRetentionPeriodResponse]
readPrec :: ReadPrec DecreaseStreamRetentionPeriodResponse
$creadPrec :: ReadPrec DecreaseStreamRetentionPeriodResponse
readList :: ReadS [DecreaseStreamRetentionPeriodResponse]
$creadList :: ReadS [DecreaseStreamRetentionPeriodResponse]
readsPrec :: Int -> ReadS DecreaseStreamRetentionPeriodResponse
$creadsPrec :: Int -> ReadS DecreaseStreamRetentionPeriodResponse
Prelude.Read, Int -> DecreaseStreamRetentionPeriodResponse -> ShowS
[DecreaseStreamRetentionPeriodResponse] -> ShowS
DecreaseStreamRetentionPeriodResponse -> String
(Int -> DecreaseStreamRetentionPeriodResponse -> ShowS)
-> (DecreaseStreamRetentionPeriodResponse -> String)
-> ([DecreaseStreamRetentionPeriodResponse] -> ShowS)
-> Show DecreaseStreamRetentionPeriodResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecreaseStreamRetentionPeriodResponse] -> ShowS
$cshowList :: [DecreaseStreamRetentionPeriodResponse] -> ShowS
show :: DecreaseStreamRetentionPeriodResponse -> String
$cshow :: DecreaseStreamRetentionPeriodResponse -> String
showsPrec :: Int -> DecreaseStreamRetentionPeriodResponse -> ShowS
$cshowsPrec :: Int -> DecreaseStreamRetentionPeriodResponse -> ShowS
Prelude.Show, (forall x.
DecreaseStreamRetentionPeriodResponse
-> Rep DecreaseStreamRetentionPeriodResponse x)
-> (forall x.
Rep DecreaseStreamRetentionPeriodResponse x
-> DecreaseStreamRetentionPeriodResponse)
-> Generic DecreaseStreamRetentionPeriodResponse
forall x.
Rep DecreaseStreamRetentionPeriodResponse x
-> DecreaseStreamRetentionPeriodResponse
forall x.
DecreaseStreamRetentionPeriodResponse
-> Rep DecreaseStreamRetentionPeriodResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DecreaseStreamRetentionPeriodResponse x
-> DecreaseStreamRetentionPeriodResponse
$cfrom :: forall x.
DecreaseStreamRetentionPeriodResponse
-> Rep DecreaseStreamRetentionPeriodResponse x
Prelude.Generic)
newDecreaseStreamRetentionPeriodResponse ::
DecreaseStreamRetentionPeriodResponse
newDecreaseStreamRetentionPeriodResponse :: DecreaseStreamRetentionPeriodResponse
newDecreaseStreamRetentionPeriodResponse =
DecreaseStreamRetentionPeriodResponse
DecreaseStreamRetentionPeriodResponse'
instance
Prelude.NFData
DecreaseStreamRetentionPeriodResponse