{-# 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.Chime.PutRetentionSettings
(
PutRetentionSettings (..),
newPutRetentionSettings,
putRetentionSettings_accountId,
putRetentionSettings_retentionSettings,
PutRetentionSettingsResponse (..),
newPutRetentionSettingsResponse,
putRetentionSettingsResponse_retentionSettings,
putRetentionSettingsResponse_initiateDeletionTimestamp,
putRetentionSettingsResponse_httpStatus,
)
where
import Amazonka.Chime.Types
import qualified Amazonka.Core as Core
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 PutRetentionSettings = PutRetentionSettings'
{
PutRetentionSettings -> Text
accountId :: Prelude.Text,
PutRetentionSettings -> RetentionSettings
retentionSettings :: RetentionSettings
}
deriving (PutRetentionSettings -> PutRetentionSettings -> Bool
(PutRetentionSettings -> PutRetentionSettings -> Bool)
-> (PutRetentionSettings -> PutRetentionSettings -> Bool)
-> Eq PutRetentionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRetentionSettings -> PutRetentionSettings -> Bool
$c/= :: PutRetentionSettings -> PutRetentionSettings -> Bool
== :: PutRetentionSettings -> PutRetentionSettings -> Bool
$c== :: PutRetentionSettings -> PutRetentionSettings -> Bool
Prelude.Eq, ReadPrec [PutRetentionSettings]
ReadPrec PutRetentionSettings
Int -> ReadS PutRetentionSettings
ReadS [PutRetentionSettings]
(Int -> ReadS PutRetentionSettings)
-> ReadS [PutRetentionSettings]
-> ReadPrec PutRetentionSettings
-> ReadPrec [PutRetentionSettings]
-> Read PutRetentionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRetentionSettings]
$creadListPrec :: ReadPrec [PutRetentionSettings]
readPrec :: ReadPrec PutRetentionSettings
$creadPrec :: ReadPrec PutRetentionSettings
readList :: ReadS [PutRetentionSettings]
$creadList :: ReadS [PutRetentionSettings]
readsPrec :: Int -> ReadS PutRetentionSettings
$creadsPrec :: Int -> ReadS PutRetentionSettings
Prelude.Read, Int -> PutRetentionSettings -> ShowS
[PutRetentionSettings] -> ShowS
PutRetentionSettings -> String
(Int -> PutRetentionSettings -> ShowS)
-> (PutRetentionSettings -> String)
-> ([PutRetentionSettings] -> ShowS)
-> Show PutRetentionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRetentionSettings] -> ShowS
$cshowList :: [PutRetentionSettings] -> ShowS
show :: PutRetentionSettings -> String
$cshow :: PutRetentionSettings -> String
showsPrec :: Int -> PutRetentionSettings -> ShowS
$cshowsPrec :: Int -> PutRetentionSettings -> ShowS
Prelude.Show, (forall x. PutRetentionSettings -> Rep PutRetentionSettings x)
-> (forall x. Rep PutRetentionSettings x -> PutRetentionSettings)
-> Generic PutRetentionSettings
forall x. Rep PutRetentionSettings x -> PutRetentionSettings
forall x. PutRetentionSettings -> Rep PutRetentionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRetentionSettings x -> PutRetentionSettings
$cfrom :: forall x. PutRetentionSettings -> Rep PutRetentionSettings x
Prelude.Generic)
newPutRetentionSettings ::
Prelude.Text ->
RetentionSettings ->
PutRetentionSettings
newPutRetentionSettings :: Text -> RetentionSettings -> PutRetentionSettings
newPutRetentionSettings
Text
pAccountId_
RetentionSettings
pRetentionSettings_ =
PutRetentionSettings' :: Text -> RetentionSettings -> PutRetentionSettings
PutRetentionSettings'
{ $sel:accountId:PutRetentionSettings' :: Text
accountId = Text
pAccountId_,
$sel:retentionSettings:PutRetentionSettings' :: RetentionSettings
retentionSettings = RetentionSettings
pRetentionSettings_
}
putRetentionSettings_accountId :: Lens.Lens' PutRetentionSettings Prelude.Text
putRetentionSettings_accountId :: (Text -> f Text) -> PutRetentionSettings -> f PutRetentionSettings
putRetentionSettings_accountId = (PutRetentionSettings -> Text)
-> (PutRetentionSettings -> Text -> PutRetentionSettings)
-> Lens PutRetentionSettings PutRetentionSettings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRetentionSettings' {Text
accountId :: Text
$sel:accountId:PutRetentionSettings' :: PutRetentionSettings -> Text
accountId} -> Text
accountId) (\s :: PutRetentionSettings
s@PutRetentionSettings' {} Text
a -> PutRetentionSettings
s {$sel:accountId:PutRetentionSettings' :: Text
accountId = Text
a} :: PutRetentionSettings)
putRetentionSettings_retentionSettings :: Lens.Lens' PutRetentionSettings RetentionSettings
putRetentionSettings_retentionSettings :: (RetentionSettings -> f RetentionSettings)
-> PutRetentionSettings -> f PutRetentionSettings
putRetentionSettings_retentionSettings = (PutRetentionSettings -> RetentionSettings)
-> (PutRetentionSettings
-> RetentionSettings -> PutRetentionSettings)
-> Lens
PutRetentionSettings
PutRetentionSettings
RetentionSettings
RetentionSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRetentionSettings' {RetentionSettings
retentionSettings :: RetentionSettings
$sel:retentionSettings:PutRetentionSettings' :: PutRetentionSettings -> RetentionSettings
retentionSettings} -> RetentionSettings
retentionSettings) (\s :: PutRetentionSettings
s@PutRetentionSettings' {} RetentionSettings
a -> PutRetentionSettings
s {$sel:retentionSettings:PutRetentionSettings' :: RetentionSettings
retentionSettings = RetentionSettings
a} :: PutRetentionSettings)
instance Core.AWSRequest PutRetentionSettings where
type
AWSResponse PutRetentionSettings =
PutRetentionSettingsResponse
request :: PutRetentionSettings -> Request PutRetentionSettings
request = Service -> PutRetentionSettings -> Request PutRetentionSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutRetentionSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutRetentionSettings)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutRetentionSettings))
-> Logger
-> Service
-> Proxy PutRetentionSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutRetentionSettings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RetentionSettings
-> Maybe POSIX -> Int -> PutRetentionSettingsResponse
PutRetentionSettingsResponse'
(Maybe RetentionSettings
-> Maybe POSIX -> Int -> PutRetentionSettingsResponse)
-> Either String (Maybe RetentionSettings)
-> Either
String (Maybe POSIX -> Int -> PutRetentionSettingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RetentionSettings)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RetentionSettings")
Either String (Maybe POSIX -> Int -> PutRetentionSettingsResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> PutRetentionSettingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InitiateDeletionTimestamp")
Either String (Int -> PutRetentionSettingsResponse)
-> Either String Int -> Either String PutRetentionSettingsResponse
forall (f :: * -> *) a b. Applicative f => 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 PutRetentionSettings
instance Prelude.NFData PutRetentionSettings
instance Core.ToHeaders PutRetentionSettings where
toHeaders :: PutRetentionSettings -> ResponseHeaders
toHeaders = ResponseHeaders -> PutRetentionSettings -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON PutRetentionSettings where
toJSON :: PutRetentionSettings -> Value
toJSON PutRetentionSettings' {Text
RetentionSettings
retentionSettings :: RetentionSettings
accountId :: Text
$sel:retentionSettings:PutRetentionSettings' :: PutRetentionSettings -> RetentionSettings
$sel:accountId:PutRetentionSettings' :: PutRetentionSettings -> 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
"RetentionSettings" Text -> RetentionSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RetentionSettings
retentionSettings)
]
)
instance Core.ToPath PutRetentionSettings where
toPath :: PutRetentionSettings -> ByteString
toPath PutRetentionSettings' {Text
RetentionSettings
retentionSettings :: RetentionSettings
accountId :: Text
$sel:retentionSettings:PutRetentionSettings' :: PutRetentionSettings -> RetentionSettings
$sel:accountId:PutRetentionSettings' :: PutRetentionSettings -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
ByteString
"/retention-settings"
]
instance Core.ToQuery PutRetentionSettings where
toQuery :: PutRetentionSettings -> QueryString
toQuery = QueryString -> PutRetentionSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutRetentionSettingsResponse = PutRetentionSettingsResponse'
{
PutRetentionSettingsResponse -> Maybe RetentionSettings
retentionSettings :: Prelude.Maybe RetentionSettings,
PutRetentionSettingsResponse -> Maybe POSIX
initiateDeletionTimestamp :: Prelude.Maybe Core.POSIX,
PutRetentionSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool
(PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool)
-> (PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool)
-> Eq PutRetentionSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool
$c/= :: PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool
== :: PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool
$c== :: PutRetentionSettingsResponse
-> PutRetentionSettingsResponse -> Bool
Prelude.Eq, ReadPrec [PutRetentionSettingsResponse]
ReadPrec PutRetentionSettingsResponse
Int -> ReadS PutRetentionSettingsResponse
ReadS [PutRetentionSettingsResponse]
(Int -> ReadS PutRetentionSettingsResponse)
-> ReadS [PutRetentionSettingsResponse]
-> ReadPrec PutRetentionSettingsResponse
-> ReadPrec [PutRetentionSettingsResponse]
-> Read PutRetentionSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRetentionSettingsResponse]
$creadListPrec :: ReadPrec [PutRetentionSettingsResponse]
readPrec :: ReadPrec PutRetentionSettingsResponse
$creadPrec :: ReadPrec PutRetentionSettingsResponse
readList :: ReadS [PutRetentionSettingsResponse]
$creadList :: ReadS [PutRetentionSettingsResponse]
readsPrec :: Int -> ReadS PutRetentionSettingsResponse
$creadsPrec :: Int -> ReadS PutRetentionSettingsResponse
Prelude.Read, Int -> PutRetentionSettingsResponse -> ShowS
[PutRetentionSettingsResponse] -> ShowS
PutRetentionSettingsResponse -> String
(Int -> PutRetentionSettingsResponse -> ShowS)
-> (PutRetentionSettingsResponse -> String)
-> ([PutRetentionSettingsResponse] -> ShowS)
-> Show PutRetentionSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRetentionSettingsResponse] -> ShowS
$cshowList :: [PutRetentionSettingsResponse] -> ShowS
show :: PutRetentionSettingsResponse -> String
$cshow :: PutRetentionSettingsResponse -> String
showsPrec :: Int -> PutRetentionSettingsResponse -> ShowS
$cshowsPrec :: Int -> PutRetentionSettingsResponse -> ShowS
Prelude.Show, (forall x.
PutRetentionSettingsResponse -> Rep PutRetentionSettingsResponse x)
-> (forall x.
Rep PutRetentionSettingsResponse x -> PutRetentionSettingsResponse)
-> Generic PutRetentionSettingsResponse
forall x.
Rep PutRetentionSettingsResponse x -> PutRetentionSettingsResponse
forall x.
PutRetentionSettingsResponse -> Rep PutRetentionSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutRetentionSettingsResponse x -> PutRetentionSettingsResponse
$cfrom :: forall x.
PutRetentionSettingsResponse -> Rep PutRetentionSettingsResponse x
Prelude.Generic)
newPutRetentionSettingsResponse ::
Prelude.Int ->
PutRetentionSettingsResponse
newPutRetentionSettingsResponse :: Int -> PutRetentionSettingsResponse
newPutRetentionSettingsResponse Int
pHttpStatus_ =
PutRetentionSettingsResponse' :: Maybe RetentionSettings
-> Maybe POSIX -> Int -> PutRetentionSettingsResponse
PutRetentionSettingsResponse'
{ $sel:retentionSettings:PutRetentionSettingsResponse' :: Maybe RetentionSettings
retentionSettings =
Maybe RetentionSettings
forall a. Maybe a
Prelude.Nothing,
$sel:initiateDeletionTimestamp:PutRetentionSettingsResponse' :: Maybe POSIX
initiateDeletionTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutRetentionSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putRetentionSettingsResponse_retentionSettings :: Lens.Lens' PutRetentionSettingsResponse (Prelude.Maybe RetentionSettings)
putRetentionSettingsResponse_retentionSettings :: (Maybe RetentionSettings -> f (Maybe RetentionSettings))
-> PutRetentionSettingsResponse -> f PutRetentionSettingsResponse
putRetentionSettingsResponse_retentionSettings = (PutRetentionSettingsResponse -> Maybe RetentionSettings)
-> (PutRetentionSettingsResponse
-> Maybe RetentionSettings -> PutRetentionSettingsResponse)
-> Lens
PutRetentionSettingsResponse
PutRetentionSettingsResponse
(Maybe RetentionSettings)
(Maybe RetentionSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRetentionSettingsResponse' {Maybe RetentionSettings
retentionSettings :: Maybe RetentionSettings
$sel:retentionSettings:PutRetentionSettingsResponse' :: PutRetentionSettingsResponse -> Maybe RetentionSettings
retentionSettings} -> Maybe RetentionSettings
retentionSettings) (\s :: PutRetentionSettingsResponse
s@PutRetentionSettingsResponse' {} Maybe RetentionSettings
a -> PutRetentionSettingsResponse
s {$sel:retentionSettings:PutRetentionSettingsResponse' :: Maybe RetentionSettings
retentionSettings = Maybe RetentionSettings
a} :: PutRetentionSettingsResponse)
putRetentionSettingsResponse_initiateDeletionTimestamp :: Lens.Lens' PutRetentionSettingsResponse (Prelude.Maybe Prelude.UTCTime)
putRetentionSettingsResponse_initiateDeletionTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PutRetentionSettingsResponse -> f PutRetentionSettingsResponse
putRetentionSettingsResponse_initiateDeletionTimestamp = (PutRetentionSettingsResponse -> Maybe POSIX)
-> (PutRetentionSettingsResponse
-> Maybe POSIX -> PutRetentionSettingsResponse)
-> Lens
PutRetentionSettingsResponse
PutRetentionSettingsResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRetentionSettingsResponse' {Maybe POSIX
initiateDeletionTimestamp :: Maybe POSIX
$sel:initiateDeletionTimestamp:PutRetentionSettingsResponse' :: PutRetentionSettingsResponse -> Maybe POSIX
initiateDeletionTimestamp} -> Maybe POSIX
initiateDeletionTimestamp) (\s :: PutRetentionSettingsResponse
s@PutRetentionSettingsResponse' {} Maybe POSIX
a -> PutRetentionSettingsResponse
s {$sel:initiateDeletionTimestamp:PutRetentionSettingsResponse' :: Maybe POSIX
initiateDeletionTimestamp = Maybe POSIX
a} :: PutRetentionSettingsResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> PutRetentionSettingsResponse -> f PutRetentionSettingsResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutRetentionSettingsResponse
-> f PutRetentionSettingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
putRetentionSettingsResponse_httpStatus :: Lens.Lens' PutRetentionSettingsResponse Prelude.Int
putRetentionSettingsResponse_httpStatus :: (Int -> f Int)
-> PutRetentionSettingsResponse -> f PutRetentionSettingsResponse
putRetentionSettingsResponse_httpStatus = (PutRetentionSettingsResponse -> Int)
-> (PutRetentionSettingsResponse
-> Int -> PutRetentionSettingsResponse)
-> Lens
PutRetentionSettingsResponse PutRetentionSettingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRetentionSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutRetentionSettingsResponse' :: PutRetentionSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutRetentionSettingsResponse
s@PutRetentionSettingsResponse' {} Int
a -> PutRetentionSettingsResponse
s {$sel:httpStatus:PutRetentionSettingsResponse' :: Int
httpStatus = Int
a} :: PutRetentionSettingsResponse)
instance Prelude.NFData PutRetentionSettingsResponse