{-# 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.ChimeSDKMessaging.UpdateChannelReadMarker
(
UpdateChannelReadMarker (..),
newUpdateChannelReadMarker,
updateChannelReadMarker_subChannelId,
updateChannelReadMarker_channelArn,
updateChannelReadMarker_chimeBearer,
UpdateChannelReadMarkerResponse (..),
newUpdateChannelReadMarkerResponse,
updateChannelReadMarkerResponse_channelArn,
updateChannelReadMarkerResponse_subChannelId,
updateChannelReadMarkerResponse_httpStatus,
)
where
import Amazonka.ChimeSDKMessaging.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateChannelReadMarker = UpdateChannelReadMarker'
{
UpdateChannelReadMarker -> Maybe Text
subChannelId :: Prelude.Maybe Prelude.Text,
UpdateChannelReadMarker -> Text
channelArn :: Prelude.Text,
UpdateChannelReadMarker -> Text
chimeBearer :: Prelude.Text
}
deriving (UpdateChannelReadMarker -> UpdateChannelReadMarker -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannelReadMarker -> UpdateChannelReadMarker -> Bool
$c/= :: UpdateChannelReadMarker -> UpdateChannelReadMarker -> Bool
== :: UpdateChannelReadMarker -> UpdateChannelReadMarker -> Bool
$c== :: UpdateChannelReadMarker -> UpdateChannelReadMarker -> Bool
Prelude.Eq, ReadPrec [UpdateChannelReadMarker]
ReadPrec UpdateChannelReadMarker
Int -> ReadS UpdateChannelReadMarker
ReadS [UpdateChannelReadMarker]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChannelReadMarker]
$creadListPrec :: ReadPrec [UpdateChannelReadMarker]
readPrec :: ReadPrec UpdateChannelReadMarker
$creadPrec :: ReadPrec UpdateChannelReadMarker
readList :: ReadS [UpdateChannelReadMarker]
$creadList :: ReadS [UpdateChannelReadMarker]
readsPrec :: Int -> ReadS UpdateChannelReadMarker
$creadsPrec :: Int -> ReadS UpdateChannelReadMarker
Prelude.Read, Int -> UpdateChannelReadMarker -> ShowS
[UpdateChannelReadMarker] -> ShowS
UpdateChannelReadMarker -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannelReadMarker] -> ShowS
$cshowList :: [UpdateChannelReadMarker] -> ShowS
show :: UpdateChannelReadMarker -> String
$cshow :: UpdateChannelReadMarker -> String
showsPrec :: Int -> UpdateChannelReadMarker -> ShowS
$cshowsPrec :: Int -> UpdateChannelReadMarker -> ShowS
Prelude.Show, forall x. Rep UpdateChannelReadMarker x -> UpdateChannelReadMarker
forall x. UpdateChannelReadMarker -> Rep UpdateChannelReadMarker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChannelReadMarker x -> UpdateChannelReadMarker
$cfrom :: forall x. UpdateChannelReadMarker -> Rep UpdateChannelReadMarker x
Prelude.Generic)
newUpdateChannelReadMarker ::
Prelude.Text ->
Prelude.Text ->
UpdateChannelReadMarker
newUpdateChannelReadMarker :: Text -> Text -> UpdateChannelReadMarker
newUpdateChannelReadMarker Text
pChannelArn_ Text
pChimeBearer_ =
UpdateChannelReadMarker'
{ $sel:subChannelId:UpdateChannelReadMarker' :: Maybe Text
subChannelId =
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:UpdateChannelReadMarker' :: Text
channelArn = Text
pChannelArn_,
$sel:chimeBearer:UpdateChannelReadMarker' :: Text
chimeBearer = Text
pChimeBearer_
}
updateChannelReadMarker_subChannelId :: Lens.Lens' UpdateChannelReadMarker (Prelude.Maybe Prelude.Text)
updateChannelReadMarker_subChannelId :: Lens' UpdateChannelReadMarker (Maybe Text)
updateChannelReadMarker_subChannelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelReadMarker' {Maybe Text
subChannelId :: Maybe Text
$sel:subChannelId:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Maybe Text
subChannelId} -> Maybe Text
subChannelId) (\s :: UpdateChannelReadMarker
s@UpdateChannelReadMarker' {} Maybe Text
a -> UpdateChannelReadMarker
s {$sel:subChannelId:UpdateChannelReadMarker' :: Maybe Text
subChannelId = Maybe Text
a} :: UpdateChannelReadMarker)
updateChannelReadMarker_channelArn :: Lens.Lens' UpdateChannelReadMarker Prelude.Text
updateChannelReadMarker_channelArn :: Lens' UpdateChannelReadMarker Text
updateChannelReadMarker_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelReadMarker' {Text
channelArn :: Text
$sel:channelArn:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
channelArn} -> Text
channelArn) (\s :: UpdateChannelReadMarker
s@UpdateChannelReadMarker' {} Text
a -> UpdateChannelReadMarker
s {$sel:channelArn:UpdateChannelReadMarker' :: Text
channelArn = Text
a} :: UpdateChannelReadMarker)
updateChannelReadMarker_chimeBearer :: Lens.Lens' UpdateChannelReadMarker Prelude.Text
updateChannelReadMarker_chimeBearer :: Lens' UpdateChannelReadMarker Text
updateChannelReadMarker_chimeBearer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelReadMarker' {Text
chimeBearer :: Text
$sel:chimeBearer:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
chimeBearer} -> Text
chimeBearer) (\s :: UpdateChannelReadMarker
s@UpdateChannelReadMarker' {} Text
a -> UpdateChannelReadMarker
s {$sel:chimeBearer:UpdateChannelReadMarker' :: Text
chimeBearer = Text
a} :: UpdateChannelReadMarker)
instance Core.AWSRequest UpdateChannelReadMarker where
type
AWSResponse UpdateChannelReadMarker =
UpdateChannelReadMarkerResponse
request :: (Service -> Service)
-> UpdateChannelReadMarker -> Request UpdateChannelReadMarker
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateChannelReadMarker
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateChannelReadMarker)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> UpdateChannelReadMarkerResponse
UpdateChannelReadMarkerResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ChannelArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SubChannelId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateChannelReadMarker where
hashWithSalt :: Int -> UpdateChannelReadMarker -> Int
hashWithSalt Int
_salt UpdateChannelReadMarker' {Maybe Text
Text
chimeBearer :: Text
channelArn :: Text
subChannelId :: Maybe Text
$sel:chimeBearer:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:channelArn:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:subChannelId:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subChannelId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
chimeBearer
instance Prelude.NFData UpdateChannelReadMarker where
rnf :: UpdateChannelReadMarker -> ()
rnf UpdateChannelReadMarker' {Maybe Text
Text
chimeBearer :: Text
channelArn :: Text
subChannelId :: Maybe Text
$sel:chimeBearer:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:channelArn:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:subChannelId:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subChannelId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
chimeBearer
instance Data.ToHeaders UpdateChannelReadMarker where
toHeaders :: UpdateChannelReadMarker -> ResponseHeaders
toHeaders UpdateChannelReadMarker' {Maybe Text
Text
chimeBearer :: Text
channelArn :: Text
subChannelId :: Maybe Text
$sel:chimeBearer:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:channelArn:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:subChannelId:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Text
chimeBearer]
instance Data.ToJSON UpdateChannelReadMarker where
toJSON :: UpdateChannelReadMarker -> Value
toJSON UpdateChannelReadMarker' {Maybe Text
Text
chimeBearer :: Text
channelArn :: Text
subChannelId :: Maybe Text
$sel:chimeBearer:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:channelArn:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:subChannelId:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"SubChannelId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
subChannelId]
)
instance Data.ToPath UpdateChannelReadMarker where
toPath :: UpdateChannelReadMarker -> ByteString
toPath UpdateChannelReadMarker' {Maybe Text
Text
chimeBearer :: Text
channelArn :: Text
subChannelId :: Maybe Text
$sel:chimeBearer:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:channelArn:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Text
$sel:subChannelId:UpdateChannelReadMarker' :: UpdateChannelReadMarker -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelArn, ByteString
"/readMarker"]
instance Data.ToQuery UpdateChannelReadMarker where
toQuery :: UpdateChannelReadMarker -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateChannelReadMarkerResponse = UpdateChannelReadMarkerResponse'
{
UpdateChannelReadMarkerResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
UpdateChannelReadMarkerResponse -> Maybe Text
subChannelId :: Prelude.Maybe Prelude.Text,
UpdateChannelReadMarkerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateChannelReadMarkerResponse
-> UpdateChannelReadMarkerResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannelReadMarkerResponse
-> UpdateChannelReadMarkerResponse -> Bool
$c/= :: UpdateChannelReadMarkerResponse
-> UpdateChannelReadMarkerResponse -> Bool
== :: UpdateChannelReadMarkerResponse
-> UpdateChannelReadMarkerResponse -> Bool
$c== :: UpdateChannelReadMarkerResponse
-> UpdateChannelReadMarkerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateChannelReadMarkerResponse]
ReadPrec UpdateChannelReadMarkerResponse
Int -> ReadS UpdateChannelReadMarkerResponse
ReadS [UpdateChannelReadMarkerResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChannelReadMarkerResponse]
$creadListPrec :: ReadPrec [UpdateChannelReadMarkerResponse]
readPrec :: ReadPrec UpdateChannelReadMarkerResponse
$creadPrec :: ReadPrec UpdateChannelReadMarkerResponse
readList :: ReadS [UpdateChannelReadMarkerResponse]
$creadList :: ReadS [UpdateChannelReadMarkerResponse]
readsPrec :: Int -> ReadS UpdateChannelReadMarkerResponse
$creadsPrec :: Int -> ReadS UpdateChannelReadMarkerResponse
Prelude.Read, Int -> UpdateChannelReadMarkerResponse -> ShowS
[UpdateChannelReadMarkerResponse] -> ShowS
UpdateChannelReadMarkerResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannelReadMarkerResponse] -> ShowS
$cshowList :: [UpdateChannelReadMarkerResponse] -> ShowS
show :: UpdateChannelReadMarkerResponse -> String
$cshow :: UpdateChannelReadMarkerResponse -> String
showsPrec :: Int -> UpdateChannelReadMarkerResponse -> ShowS
$cshowsPrec :: Int -> UpdateChannelReadMarkerResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateChannelReadMarkerResponse x
-> UpdateChannelReadMarkerResponse
forall x.
UpdateChannelReadMarkerResponse
-> Rep UpdateChannelReadMarkerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateChannelReadMarkerResponse x
-> UpdateChannelReadMarkerResponse
$cfrom :: forall x.
UpdateChannelReadMarkerResponse
-> Rep UpdateChannelReadMarkerResponse x
Prelude.Generic)
newUpdateChannelReadMarkerResponse ::
Prelude.Int ->
UpdateChannelReadMarkerResponse
newUpdateChannelReadMarkerResponse :: Int -> UpdateChannelReadMarkerResponse
newUpdateChannelReadMarkerResponse Int
pHttpStatus_ =
UpdateChannelReadMarkerResponse'
{ $sel:channelArn:UpdateChannelReadMarkerResponse' :: Maybe Text
channelArn =
forall a. Maybe a
Prelude.Nothing,
$sel:subChannelId:UpdateChannelReadMarkerResponse' :: Maybe Text
subChannelId = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateChannelReadMarkerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateChannelReadMarkerResponse_channelArn :: Lens.Lens' UpdateChannelReadMarkerResponse (Prelude.Maybe Prelude.Text)
updateChannelReadMarkerResponse_channelArn :: Lens' UpdateChannelReadMarkerResponse (Maybe Text)
updateChannelReadMarkerResponse_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelReadMarkerResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:UpdateChannelReadMarkerResponse' :: UpdateChannelReadMarkerResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: UpdateChannelReadMarkerResponse
s@UpdateChannelReadMarkerResponse' {} Maybe Text
a -> UpdateChannelReadMarkerResponse
s {$sel:channelArn:UpdateChannelReadMarkerResponse' :: Maybe Text
channelArn = Maybe Text
a} :: UpdateChannelReadMarkerResponse)
updateChannelReadMarkerResponse_subChannelId :: Lens.Lens' UpdateChannelReadMarkerResponse (Prelude.Maybe Prelude.Text)
updateChannelReadMarkerResponse_subChannelId :: Lens' UpdateChannelReadMarkerResponse (Maybe Text)
updateChannelReadMarkerResponse_subChannelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelReadMarkerResponse' {Maybe Text
subChannelId :: Maybe Text
$sel:subChannelId:UpdateChannelReadMarkerResponse' :: UpdateChannelReadMarkerResponse -> Maybe Text
subChannelId} -> Maybe Text
subChannelId) (\s :: UpdateChannelReadMarkerResponse
s@UpdateChannelReadMarkerResponse' {} Maybe Text
a -> UpdateChannelReadMarkerResponse
s {$sel:subChannelId:UpdateChannelReadMarkerResponse' :: Maybe Text
subChannelId = Maybe Text
a} :: UpdateChannelReadMarkerResponse)
updateChannelReadMarkerResponse_httpStatus :: Lens.Lens' UpdateChannelReadMarkerResponse Prelude.Int
updateChannelReadMarkerResponse_httpStatus :: Lens' UpdateChannelReadMarkerResponse Int
updateChannelReadMarkerResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelReadMarkerResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateChannelReadMarkerResponse' :: UpdateChannelReadMarkerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateChannelReadMarkerResponse
s@UpdateChannelReadMarkerResponse' {} Int
a -> UpdateChannelReadMarkerResponse
s {$sel:httpStatus:UpdateChannelReadMarkerResponse' :: Int
httpStatus = Int
a} :: UpdateChannelReadMarkerResponse)
instance
Prelude.NFData
UpdateChannelReadMarkerResponse
where
rnf :: UpdateChannelReadMarkerResponse -> ()
rnf UpdateChannelReadMarkerResponse' {Int
Maybe Text
httpStatus :: Int
subChannelId :: Maybe Text
channelArn :: Maybe Text
$sel:httpStatus:UpdateChannelReadMarkerResponse' :: UpdateChannelReadMarkerResponse -> Int
$sel:subChannelId:UpdateChannelReadMarkerResponse' :: UpdateChannelReadMarkerResponse -> Maybe Text
$sel:channelArn:UpdateChannelReadMarkerResponse' :: UpdateChannelReadMarkerResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subChannelId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus