{-# 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.GetChannelMessageStatus
(
GetChannelMessageStatus (..),
newGetChannelMessageStatus,
getChannelMessageStatus_channelArn,
getChannelMessageStatus_messageId,
getChannelMessageStatus_chimeBearer,
GetChannelMessageStatusResponse (..),
newGetChannelMessageStatusResponse,
getChannelMessageStatusResponse_status,
getChannelMessageStatusResponse_httpStatus,
)
where
import Amazonka.ChimeSDKMessaging.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 GetChannelMessageStatus = GetChannelMessageStatus'
{
GetChannelMessageStatus -> Text
channelArn :: Prelude.Text,
GetChannelMessageStatus -> Text
messageId :: Prelude.Text,
GetChannelMessageStatus -> Text
chimeBearer :: Prelude.Text
}
deriving (GetChannelMessageStatus -> GetChannelMessageStatus -> Bool
(GetChannelMessageStatus -> GetChannelMessageStatus -> Bool)
-> (GetChannelMessageStatus -> GetChannelMessageStatus -> Bool)
-> Eq GetChannelMessageStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetChannelMessageStatus -> GetChannelMessageStatus -> Bool
$c/= :: GetChannelMessageStatus -> GetChannelMessageStatus -> Bool
== :: GetChannelMessageStatus -> GetChannelMessageStatus -> Bool
$c== :: GetChannelMessageStatus -> GetChannelMessageStatus -> Bool
Prelude.Eq, ReadPrec [GetChannelMessageStatus]
ReadPrec GetChannelMessageStatus
Int -> ReadS GetChannelMessageStatus
ReadS [GetChannelMessageStatus]
(Int -> ReadS GetChannelMessageStatus)
-> ReadS [GetChannelMessageStatus]
-> ReadPrec GetChannelMessageStatus
-> ReadPrec [GetChannelMessageStatus]
-> Read GetChannelMessageStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetChannelMessageStatus]
$creadListPrec :: ReadPrec [GetChannelMessageStatus]
readPrec :: ReadPrec GetChannelMessageStatus
$creadPrec :: ReadPrec GetChannelMessageStatus
readList :: ReadS [GetChannelMessageStatus]
$creadList :: ReadS [GetChannelMessageStatus]
readsPrec :: Int -> ReadS GetChannelMessageStatus
$creadsPrec :: Int -> ReadS GetChannelMessageStatus
Prelude.Read, Int -> GetChannelMessageStatus -> ShowS
[GetChannelMessageStatus] -> ShowS
GetChannelMessageStatus -> String
(Int -> GetChannelMessageStatus -> ShowS)
-> (GetChannelMessageStatus -> String)
-> ([GetChannelMessageStatus] -> ShowS)
-> Show GetChannelMessageStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetChannelMessageStatus] -> ShowS
$cshowList :: [GetChannelMessageStatus] -> ShowS
show :: GetChannelMessageStatus -> String
$cshow :: GetChannelMessageStatus -> String
showsPrec :: Int -> GetChannelMessageStatus -> ShowS
$cshowsPrec :: Int -> GetChannelMessageStatus -> ShowS
Prelude.Show, (forall x.
GetChannelMessageStatus -> Rep GetChannelMessageStatus x)
-> (forall x.
Rep GetChannelMessageStatus x -> GetChannelMessageStatus)
-> Generic GetChannelMessageStatus
forall x. Rep GetChannelMessageStatus x -> GetChannelMessageStatus
forall x. GetChannelMessageStatus -> Rep GetChannelMessageStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetChannelMessageStatus x -> GetChannelMessageStatus
$cfrom :: forall x. GetChannelMessageStatus -> Rep GetChannelMessageStatus x
Prelude.Generic)
newGetChannelMessageStatus ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetChannelMessageStatus
newGetChannelMessageStatus :: Text -> Text -> Text -> GetChannelMessageStatus
newGetChannelMessageStatus
Text
pChannelArn_
Text
pMessageId_
Text
pChimeBearer_ =
GetChannelMessageStatus' :: Text -> Text -> Text -> GetChannelMessageStatus
GetChannelMessageStatus'
{ $sel:channelArn:GetChannelMessageStatus' :: Text
channelArn = Text
pChannelArn_,
$sel:messageId:GetChannelMessageStatus' :: Text
messageId = Text
pMessageId_,
$sel:chimeBearer:GetChannelMessageStatus' :: Text
chimeBearer = Text
pChimeBearer_
}
getChannelMessageStatus_channelArn :: Lens.Lens' GetChannelMessageStatus Prelude.Text
getChannelMessageStatus_channelArn :: (Text -> f Text)
-> GetChannelMessageStatus -> f GetChannelMessageStatus
getChannelMessageStatus_channelArn = (GetChannelMessageStatus -> Text)
-> (GetChannelMessageStatus -> Text -> GetChannelMessageStatus)
-> Lens GetChannelMessageStatus GetChannelMessageStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelMessageStatus' {Text
channelArn :: Text
$sel:channelArn:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
channelArn} -> Text
channelArn) (\s :: GetChannelMessageStatus
s@GetChannelMessageStatus' {} Text
a -> GetChannelMessageStatus
s {$sel:channelArn:GetChannelMessageStatus' :: Text
channelArn = Text
a} :: GetChannelMessageStatus)
getChannelMessageStatus_messageId :: Lens.Lens' GetChannelMessageStatus Prelude.Text
getChannelMessageStatus_messageId :: (Text -> f Text)
-> GetChannelMessageStatus -> f GetChannelMessageStatus
getChannelMessageStatus_messageId = (GetChannelMessageStatus -> Text)
-> (GetChannelMessageStatus -> Text -> GetChannelMessageStatus)
-> Lens GetChannelMessageStatus GetChannelMessageStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelMessageStatus' {Text
messageId :: Text
$sel:messageId:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
messageId} -> Text
messageId) (\s :: GetChannelMessageStatus
s@GetChannelMessageStatus' {} Text
a -> GetChannelMessageStatus
s {$sel:messageId:GetChannelMessageStatus' :: Text
messageId = Text
a} :: GetChannelMessageStatus)
getChannelMessageStatus_chimeBearer :: Lens.Lens' GetChannelMessageStatus Prelude.Text
getChannelMessageStatus_chimeBearer :: (Text -> f Text)
-> GetChannelMessageStatus -> f GetChannelMessageStatus
getChannelMessageStatus_chimeBearer = (GetChannelMessageStatus -> Text)
-> (GetChannelMessageStatus -> Text -> GetChannelMessageStatus)
-> Lens GetChannelMessageStatus GetChannelMessageStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelMessageStatus' {Text
chimeBearer :: Text
$sel:chimeBearer:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
chimeBearer} -> Text
chimeBearer) (\s :: GetChannelMessageStatus
s@GetChannelMessageStatus' {} Text
a -> GetChannelMessageStatus
s {$sel:chimeBearer:GetChannelMessageStatus' :: Text
chimeBearer = Text
a} :: GetChannelMessageStatus)
instance Core.AWSRequest GetChannelMessageStatus where
type
AWSResponse GetChannelMessageStatus =
GetChannelMessageStatusResponse
request :: GetChannelMessageStatus -> Request GetChannelMessageStatus
request = Service
-> GetChannelMessageStatus -> Request GetChannelMessageStatus
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetChannelMessageStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetChannelMessageStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetChannelMessageStatus))
-> Logger
-> Service
-> Proxy GetChannelMessageStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetChannelMessageStatus)))
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 ChannelMessageStatusStructure
-> Int -> GetChannelMessageStatusResponse
GetChannelMessageStatusResponse'
(Maybe ChannelMessageStatusStructure
-> Int -> GetChannelMessageStatusResponse)
-> Either String (Maybe ChannelMessageStatusStructure)
-> Either String (Int -> GetChannelMessageStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe ChannelMessageStatusStructure)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
Either String (Int -> GetChannelMessageStatusResponse)
-> Either String Int
-> Either String GetChannelMessageStatusResponse
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 GetChannelMessageStatus
instance Prelude.NFData GetChannelMessageStatus
instance Core.ToHeaders GetChannelMessageStatus where
toHeaders :: GetChannelMessageStatus -> ResponseHeaders
toHeaders GetChannelMessageStatus' {Text
chimeBearer :: Text
messageId :: Text
channelArn :: Text
$sel:chimeBearer:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
$sel:messageId:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
$sel:channelArn:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
chimeBearer]
instance Core.ToPath GetChannelMessageStatus where
toPath :: GetChannelMessageStatus -> ByteString
toPath GetChannelMessageStatus' {Text
chimeBearer :: Text
messageId :: Text
channelArn :: Text
$sel:chimeBearer:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
$sel:messageId:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
$sel:channelArn:GetChannelMessageStatus' :: GetChannelMessageStatus -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/channels/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelArn,
ByteString
"/messages/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
messageId
]
instance Core.ToQuery GetChannelMessageStatus where
toQuery :: GetChannelMessageStatus -> QueryString
toQuery =
QueryString -> GetChannelMessageStatus -> QueryString
forall a b. a -> b -> a
Prelude.const
([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"scope=message-status"])
data GetChannelMessageStatusResponse = GetChannelMessageStatusResponse'
{
GetChannelMessageStatusResponse
-> Maybe ChannelMessageStatusStructure
status :: Prelude.Maybe ChannelMessageStatusStructure,
GetChannelMessageStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool
(GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool)
-> (GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool)
-> Eq GetChannelMessageStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool
$c/= :: GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool
== :: GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool
$c== :: GetChannelMessageStatusResponse
-> GetChannelMessageStatusResponse -> Bool
Prelude.Eq, ReadPrec [GetChannelMessageStatusResponse]
ReadPrec GetChannelMessageStatusResponse
Int -> ReadS GetChannelMessageStatusResponse
ReadS [GetChannelMessageStatusResponse]
(Int -> ReadS GetChannelMessageStatusResponse)
-> ReadS [GetChannelMessageStatusResponse]
-> ReadPrec GetChannelMessageStatusResponse
-> ReadPrec [GetChannelMessageStatusResponse]
-> Read GetChannelMessageStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetChannelMessageStatusResponse]
$creadListPrec :: ReadPrec [GetChannelMessageStatusResponse]
readPrec :: ReadPrec GetChannelMessageStatusResponse
$creadPrec :: ReadPrec GetChannelMessageStatusResponse
readList :: ReadS [GetChannelMessageStatusResponse]
$creadList :: ReadS [GetChannelMessageStatusResponse]
readsPrec :: Int -> ReadS GetChannelMessageStatusResponse
$creadsPrec :: Int -> ReadS GetChannelMessageStatusResponse
Prelude.Read, Int -> GetChannelMessageStatusResponse -> ShowS
[GetChannelMessageStatusResponse] -> ShowS
GetChannelMessageStatusResponse -> String
(Int -> GetChannelMessageStatusResponse -> ShowS)
-> (GetChannelMessageStatusResponse -> String)
-> ([GetChannelMessageStatusResponse] -> ShowS)
-> Show GetChannelMessageStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetChannelMessageStatusResponse] -> ShowS
$cshowList :: [GetChannelMessageStatusResponse] -> ShowS
show :: GetChannelMessageStatusResponse -> String
$cshow :: GetChannelMessageStatusResponse -> String
showsPrec :: Int -> GetChannelMessageStatusResponse -> ShowS
$cshowsPrec :: Int -> GetChannelMessageStatusResponse -> ShowS
Prelude.Show, (forall x.
GetChannelMessageStatusResponse
-> Rep GetChannelMessageStatusResponse x)
-> (forall x.
Rep GetChannelMessageStatusResponse x
-> GetChannelMessageStatusResponse)
-> Generic GetChannelMessageStatusResponse
forall x.
Rep GetChannelMessageStatusResponse x
-> GetChannelMessageStatusResponse
forall x.
GetChannelMessageStatusResponse
-> Rep GetChannelMessageStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetChannelMessageStatusResponse x
-> GetChannelMessageStatusResponse
$cfrom :: forall x.
GetChannelMessageStatusResponse
-> Rep GetChannelMessageStatusResponse x
Prelude.Generic)
newGetChannelMessageStatusResponse ::
Prelude.Int ->
GetChannelMessageStatusResponse
newGetChannelMessageStatusResponse :: Int -> GetChannelMessageStatusResponse
newGetChannelMessageStatusResponse Int
pHttpStatus_ =
GetChannelMessageStatusResponse' :: Maybe ChannelMessageStatusStructure
-> Int -> GetChannelMessageStatusResponse
GetChannelMessageStatusResponse'
{ $sel:status:GetChannelMessageStatusResponse' :: Maybe ChannelMessageStatusStructure
status =
Maybe ChannelMessageStatusStructure
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetChannelMessageStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getChannelMessageStatusResponse_status :: Lens.Lens' GetChannelMessageStatusResponse (Prelude.Maybe ChannelMessageStatusStructure)
getChannelMessageStatusResponse_status :: (Maybe ChannelMessageStatusStructure
-> f (Maybe ChannelMessageStatusStructure))
-> GetChannelMessageStatusResponse
-> f GetChannelMessageStatusResponse
getChannelMessageStatusResponse_status = (GetChannelMessageStatusResponse
-> Maybe ChannelMessageStatusStructure)
-> (GetChannelMessageStatusResponse
-> Maybe ChannelMessageStatusStructure
-> GetChannelMessageStatusResponse)
-> Lens
GetChannelMessageStatusResponse
GetChannelMessageStatusResponse
(Maybe ChannelMessageStatusStructure)
(Maybe ChannelMessageStatusStructure)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelMessageStatusResponse' {Maybe ChannelMessageStatusStructure
status :: Maybe ChannelMessageStatusStructure
$sel:status:GetChannelMessageStatusResponse' :: GetChannelMessageStatusResponse
-> Maybe ChannelMessageStatusStructure
status} -> Maybe ChannelMessageStatusStructure
status) (\s :: GetChannelMessageStatusResponse
s@GetChannelMessageStatusResponse' {} Maybe ChannelMessageStatusStructure
a -> GetChannelMessageStatusResponse
s {$sel:status:GetChannelMessageStatusResponse' :: Maybe ChannelMessageStatusStructure
status = Maybe ChannelMessageStatusStructure
a} :: GetChannelMessageStatusResponse)
getChannelMessageStatusResponse_httpStatus :: Lens.Lens' GetChannelMessageStatusResponse Prelude.Int
getChannelMessageStatusResponse_httpStatus :: (Int -> f Int)
-> GetChannelMessageStatusResponse
-> f GetChannelMessageStatusResponse
getChannelMessageStatusResponse_httpStatus = (GetChannelMessageStatusResponse -> Int)
-> (GetChannelMessageStatusResponse
-> Int -> GetChannelMessageStatusResponse)
-> Lens
GetChannelMessageStatusResponse
GetChannelMessageStatusResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelMessageStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetChannelMessageStatusResponse' :: GetChannelMessageStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetChannelMessageStatusResponse
s@GetChannelMessageStatusResponse' {} Int
a -> GetChannelMessageStatusResponse
s {$sel:httpStatus:GetChannelMessageStatusResponse' :: Int
httpStatus = Int
a} :: GetChannelMessageStatusResponse)
instance
Prelude.NFData
GetChannelMessageStatusResponse