{-# 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.KinesisVideo.UpdateDataRetention
(
UpdateDataRetention (..),
newUpdateDataRetention,
updateDataRetention_streamARN,
updateDataRetention_streamName,
updateDataRetention_currentVersion,
updateDataRetention_operation,
updateDataRetention_dataRetentionChangeInHours,
UpdateDataRetentionResponse (..),
newUpdateDataRetentionResponse,
updateDataRetentionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideo.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 UpdateDataRetention = UpdateDataRetention'
{
UpdateDataRetention -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
UpdateDataRetention -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
UpdateDataRetention -> Text
currentVersion :: Prelude.Text,
UpdateDataRetention -> UpdateDataRetentionOperation
operation :: UpdateDataRetentionOperation,
UpdateDataRetention -> Natural
dataRetentionChangeInHours :: Prelude.Natural
}
deriving (UpdateDataRetention -> UpdateDataRetention -> Bool
(UpdateDataRetention -> UpdateDataRetention -> Bool)
-> (UpdateDataRetention -> UpdateDataRetention -> Bool)
-> Eq UpdateDataRetention
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataRetention -> UpdateDataRetention -> Bool
$c/= :: UpdateDataRetention -> UpdateDataRetention -> Bool
== :: UpdateDataRetention -> UpdateDataRetention -> Bool
$c== :: UpdateDataRetention -> UpdateDataRetention -> Bool
Prelude.Eq, ReadPrec [UpdateDataRetention]
ReadPrec UpdateDataRetention
Int -> ReadS UpdateDataRetention
ReadS [UpdateDataRetention]
(Int -> ReadS UpdateDataRetention)
-> ReadS [UpdateDataRetention]
-> ReadPrec UpdateDataRetention
-> ReadPrec [UpdateDataRetention]
-> Read UpdateDataRetention
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataRetention]
$creadListPrec :: ReadPrec [UpdateDataRetention]
readPrec :: ReadPrec UpdateDataRetention
$creadPrec :: ReadPrec UpdateDataRetention
readList :: ReadS [UpdateDataRetention]
$creadList :: ReadS [UpdateDataRetention]
readsPrec :: Int -> ReadS UpdateDataRetention
$creadsPrec :: Int -> ReadS UpdateDataRetention
Prelude.Read, Int -> UpdateDataRetention -> ShowS
[UpdateDataRetention] -> ShowS
UpdateDataRetention -> String
(Int -> UpdateDataRetention -> ShowS)
-> (UpdateDataRetention -> String)
-> ([UpdateDataRetention] -> ShowS)
-> Show UpdateDataRetention
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataRetention] -> ShowS
$cshowList :: [UpdateDataRetention] -> ShowS
show :: UpdateDataRetention -> String
$cshow :: UpdateDataRetention -> String
showsPrec :: Int -> UpdateDataRetention -> ShowS
$cshowsPrec :: Int -> UpdateDataRetention -> ShowS
Prelude.Show, (forall x. UpdateDataRetention -> Rep UpdateDataRetention x)
-> (forall x. Rep UpdateDataRetention x -> UpdateDataRetention)
-> Generic UpdateDataRetention
forall x. Rep UpdateDataRetention x -> UpdateDataRetention
forall x. UpdateDataRetention -> Rep UpdateDataRetention x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDataRetention x -> UpdateDataRetention
$cfrom :: forall x. UpdateDataRetention -> Rep UpdateDataRetention x
Prelude.Generic)
newUpdateDataRetention ::
Prelude.Text ->
UpdateDataRetentionOperation ->
Prelude.Natural ->
UpdateDataRetention
newUpdateDataRetention :: Text
-> UpdateDataRetentionOperation -> Natural -> UpdateDataRetention
newUpdateDataRetention
Text
pCurrentVersion_
UpdateDataRetentionOperation
pOperation_
Natural
pDataRetentionChangeInHours_ =
UpdateDataRetention' :: Maybe Text
-> Maybe Text
-> Text
-> UpdateDataRetentionOperation
-> Natural
-> UpdateDataRetention
UpdateDataRetention'
{ $sel:streamARN:UpdateDataRetention' :: Maybe Text
streamARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:UpdateDataRetention' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:currentVersion:UpdateDataRetention' :: Text
currentVersion = Text
pCurrentVersion_,
$sel:operation:UpdateDataRetention' :: UpdateDataRetentionOperation
operation = UpdateDataRetentionOperation
pOperation_,
$sel:dataRetentionChangeInHours:UpdateDataRetention' :: Natural
dataRetentionChangeInHours =
Natural
pDataRetentionChangeInHours_
}
updateDataRetention_streamARN :: Lens.Lens' UpdateDataRetention (Prelude.Maybe Prelude.Text)
updateDataRetention_streamARN :: (Maybe Text -> f (Maybe Text))
-> UpdateDataRetention -> f UpdateDataRetention
updateDataRetention_streamARN = (UpdateDataRetention -> Maybe Text)
-> (UpdateDataRetention -> Maybe Text -> UpdateDataRetention)
-> Lens
UpdateDataRetention UpdateDataRetention (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataRetention' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:UpdateDataRetention' :: UpdateDataRetention -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: UpdateDataRetention
s@UpdateDataRetention' {} Maybe Text
a -> UpdateDataRetention
s {$sel:streamARN:UpdateDataRetention' :: Maybe Text
streamARN = Maybe Text
a} :: UpdateDataRetention)
updateDataRetention_streamName :: Lens.Lens' UpdateDataRetention (Prelude.Maybe Prelude.Text)
updateDataRetention_streamName :: (Maybe Text -> f (Maybe Text))
-> UpdateDataRetention -> f UpdateDataRetention
updateDataRetention_streamName = (UpdateDataRetention -> Maybe Text)
-> (UpdateDataRetention -> Maybe Text -> UpdateDataRetention)
-> Lens
UpdateDataRetention UpdateDataRetention (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataRetention' {Maybe Text
streamName :: Maybe Text
$sel:streamName:UpdateDataRetention' :: UpdateDataRetention -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: UpdateDataRetention
s@UpdateDataRetention' {} Maybe Text
a -> UpdateDataRetention
s {$sel:streamName:UpdateDataRetention' :: Maybe Text
streamName = Maybe Text
a} :: UpdateDataRetention)
updateDataRetention_currentVersion :: Lens.Lens' UpdateDataRetention Prelude.Text
updateDataRetention_currentVersion :: (Text -> f Text) -> UpdateDataRetention -> f UpdateDataRetention
updateDataRetention_currentVersion = (UpdateDataRetention -> Text)
-> (UpdateDataRetention -> Text -> UpdateDataRetention)
-> Lens UpdateDataRetention UpdateDataRetention Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataRetention' {Text
currentVersion :: Text
$sel:currentVersion:UpdateDataRetention' :: UpdateDataRetention -> Text
currentVersion} -> Text
currentVersion) (\s :: UpdateDataRetention
s@UpdateDataRetention' {} Text
a -> UpdateDataRetention
s {$sel:currentVersion:UpdateDataRetention' :: Text
currentVersion = Text
a} :: UpdateDataRetention)
updateDataRetention_operation :: Lens.Lens' UpdateDataRetention UpdateDataRetentionOperation
updateDataRetention_operation :: (UpdateDataRetentionOperation -> f UpdateDataRetentionOperation)
-> UpdateDataRetention -> f UpdateDataRetention
updateDataRetention_operation = (UpdateDataRetention -> UpdateDataRetentionOperation)
-> (UpdateDataRetention
-> UpdateDataRetentionOperation -> UpdateDataRetention)
-> Lens
UpdateDataRetention
UpdateDataRetention
UpdateDataRetentionOperation
UpdateDataRetentionOperation
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataRetention' {UpdateDataRetentionOperation
operation :: UpdateDataRetentionOperation
$sel:operation:UpdateDataRetention' :: UpdateDataRetention -> UpdateDataRetentionOperation
operation} -> UpdateDataRetentionOperation
operation) (\s :: UpdateDataRetention
s@UpdateDataRetention' {} UpdateDataRetentionOperation
a -> UpdateDataRetention
s {$sel:operation:UpdateDataRetention' :: UpdateDataRetentionOperation
operation = UpdateDataRetentionOperation
a} :: UpdateDataRetention)
updateDataRetention_dataRetentionChangeInHours :: Lens.Lens' UpdateDataRetention Prelude.Natural
updateDataRetention_dataRetentionChangeInHours :: (Natural -> f Natural)
-> UpdateDataRetention -> f UpdateDataRetention
updateDataRetention_dataRetentionChangeInHours = (UpdateDataRetention -> Natural)
-> (UpdateDataRetention -> Natural -> UpdateDataRetention)
-> Lens UpdateDataRetention UpdateDataRetention Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataRetention' {Natural
dataRetentionChangeInHours :: Natural
$sel:dataRetentionChangeInHours:UpdateDataRetention' :: UpdateDataRetention -> Natural
dataRetentionChangeInHours} -> Natural
dataRetentionChangeInHours) (\s :: UpdateDataRetention
s@UpdateDataRetention' {} Natural
a -> UpdateDataRetention
s {$sel:dataRetentionChangeInHours:UpdateDataRetention' :: Natural
dataRetentionChangeInHours = Natural
a} :: UpdateDataRetention)
instance Core.AWSRequest UpdateDataRetention where
type
AWSResponse UpdateDataRetention =
UpdateDataRetentionResponse
request :: UpdateDataRetention -> Request UpdateDataRetention
request = Service -> UpdateDataRetention -> Request UpdateDataRetention
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDataRetention
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDataRetention)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateDataRetention))
-> Logger
-> Service
-> Proxy UpdateDataRetention
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDataRetention)))
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 -> UpdateDataRetentionResponse
UpdateDataRetentionResponse'
(Int -> UpdateDataRetentionResponse)
-> Either String Int -> Either String UpdateDataRetentionResponse
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 UpdateDataRetention
instance Prelude.NFData UpdateDataRetention
instance Core.ToHeaders UpdateDataRetention where
toHeaders :: UpdateDataRetention -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateDataRetention -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateDataRetention where
toJSON :: UpdateDataRetention -> Value
toJSON UpdateDataRetention' {Natural
Maybe Text
Text
UpdateDataRetentionOperation
dataRetentionChangeInHours :: Natural
operation :: UpdateDataRetentionOperation
currentVersion :: Text
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:dataRetentionChangeInHours:UpdateDataRetention' :: UpdateDataRetention -> Natural
$sel:operation:UpdateDataRetention' :: UpdateDataRetention -> UpdateDataRetentionOperation
$sel:currentVersion:UpdateDataRetention' :: UpdateDataRetention -> Text
$sel:streamName:UpdateDataRetention' :: UpdateDataRetention -> Maybe Text
$sel:streamARN:UpdateDataRetention' :: UpdateDataRetention -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StreamARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamARN,
(Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"CurrentVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
currentVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Operation" Text -> UpdateDataRetentionOperation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UpdateDataRetentionOperation
operation),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DataRetentionChangeInHours"
Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
dataRetentionChangeInHours
)
]
)
instance Core.ToPath UpdateDataRetention where
toPath :: UpdateDataRetention -> ByteString
toPath = ByteString -> UpdateDataRetention -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/updateDataRetention"
instance Core.ToQuery UpdateDataRetention where
toQuery :: UpdateDataRetention -> QueryString
toQuery = QueryString -> UpdateDataRetention -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDataRetentionResponse = UpdateDataRetentionResponse'
{
UpdateDataRetentionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDataRetentionResponse -> UpdateDataRetentionResponse -> Bool
(UpdateDataRetentionResponse
-> UpdateDataRetentionResponse -> Bool)
-> (UpdateDataRetentionResponse
-> UpdateDataRetentionResponse -> Bool)
-> Eq UpdateDataRetentionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDataRetentionResponse -> UpdateDataRetentionResponse -> Bool
$c/= :: UpdateDataRetentionResponse -> UpdateDataRetentionResponse -> Bool
== :: UpdateDataRetentionResponse -> UpdateDataRetentionResponse -> Bool
$c== :: UpdateDataRetentionResponse -> UpdateDataRetentionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDataRetentionResponse]
ReadPrec UpdateDataRetentionResponse
Int -> ReadS UpdateDataRetentionResponse
ReadS [UpdateDataRetentionResponse]
(Int -> ReadS UpdateDataRetentionResponse)
-> ReadS [UpdateDataRetentionResponse]
-> ReadPrec UpdateDataRetentionResponse
-> ReadPrec [UpdateDataRetentionResponse]
-> Read UpdateDataRetentionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDataRetentionResponse]
$creadListPrec :: ReadPrec [UpdateDataRetentionResponse]
readPrec :: ReadPrec UpdateDataRetentionResponse
$creadPrec :: ReadPrec UpdateDataRetentionResponse
readList :: ReadS [UpdateDataRetentionResponse]
$creadList :: ReadS [UpdateDataRetentionResponse]
readsPrec :: Int -> ReadS UpdateDataRetentionResponse
$creadsPrec :: Int -> ReadS UpdateDataRetentionResponse
Prelude.Read, Int -> UpdateDataRetentionResponse -> ShowS
[UpdateDataRetentionResponse] -> ShowS
UpdateDataRetentionResponse -> String
(Int -> UpdateDataRetentionResponse -> ShowS)
-> (UpdateDataRetentionResponse -> String)
-> ([UpdateDataRetentionResponse] -> ShowS)
-> Show UpdateDataRetentionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDataRetentionResponse] -> ShowS
$cshowList :: [UpdateDataRetentionResponse] -> ShowS
show :: UpdateDataRetentionResponse -> String
$cshow :: UpdateDataRetentionResponse -> String
showsPrec :: Int -> UpdateDataRetentionResponse -> ShowS
$cshowsPrec :: Int -> UpdateDataRetentionResponse -> ShowS
Prelude.Show, (forall x.
UpdateDataRetentionResponse -> Rep UpdateDataRetentionResponse x)
-> (forall x.
Rep UpdateDataRetentionResponse x -> UpdateDataRetentionResponse)
-> Generic UpdateDataRetentionResponse
forall x.
Rep UpdateDataRetentionResponse x -> UpdateDataRetentionResponse
forall x.
UpdateDataRetentionResponse -> Rep UpdateDataRetentionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDataRetentionResponse x -> UpdateDataRetentionResponse
$cfrom :: forall x.
UpdateDataRetentionResponse -> Rep UpdateDataRetentionResponse x
Prelude.Generic)
newUpdateDataRetentionResponse ::
Prelude.Int ->
UpdateDataRetentionResponse
newUpdateDataRetentionResponse :: Int -> UpdateDataRetentionResponse
newUpdateDataRetentionResponse Int
pHttpStatus_ =
UpdateDataRetentionResponse' :: Int -> UpdateDataRetentionResponse
UpdateDataRetentionResponse'
{ $sel:httpStatus:UpdateDataRetentionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateDataRetentionResponse_httpStatus :: Lens.Lens' UpdateDataRetentionResponse Prelude.Int
updateDataRetentionResponse_httpStatus :: (Int -> f Int)
-> UpdateDataRetentionResponse -> f UpdateDataRetentionResponse
updateDataRetentionResponse_httpStatus = (UpdateDataRetentionResponse -> Int)
-> (UpdateDataRetentionResponse
-> Int -> UpdateDataRetentionResponse)
-> Lens
UpdateDataRetentionResponse UpdateDataRetentionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDataRetentionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDataRetentionResponse' :: UpdateDataRetentionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDataRetentionResponse
s@UpdateDataRetentionResponse' {} Int
a -> UpdateDataRetentionResponse
s {$sel:httpStatus:UpdateDataRetentionResponse' :: Int
httpStatus = Int
a} :: UpdateDataRetentionResponse)
instance Prelude.NFData UpdateDataRetentionResponse