{-# 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.SendChannelMessage
(
SendChannelMessage (..),
newSendChannelMessage,
sendChannelMessage_metadata,
sendChannelMessage_channelArn,
sendChannelMessage_content,
sendChannelMessage_type,
sendChannelMessage_persistence,
sendChannelMessage_clientRequestToken,
sendChannelMessage_chimeBearer,
SendChannelMessageResponse (..),
newSendChannelMessageResponse,
sendChannelMessageResponse_status,
sendChannelMessageResponse_channelArn,
sendChannelMessageResponse_messageId,
sendChannelMessageResponse_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 SendChannelMessage = SendChannelMessage'
{
SendChannelMessage -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text),
SendChannelMessage -> Text
channelArn :: Prelude.Text,
SendChannelMessage -> Sensitive Text
content :: Core.Sensitive Prelude.Text,
SendChannelMessage -> ChannelMessageType
type' :: ChannelMessageType,
SendChannelMessage -> ChannelMessagePersistenceType
persistence :: ChannelMessagePersistenceType,
SendChannelMessage -> Sensitive Text
clientRequestToken :: Core.Sensitive Prelude.Text,
SendChannelMessage -> Text
chimeBearer :: Prelude.Text
}
deriving (SendChannelMessage -> SendChannelMessage -> Bool
(SendChannelMessage -> SendChannelMessage -> Bool)
-> (SendChannelMessage -> SendChannelMessage -> Bool)
-> Eq SendChannelMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendChannelMessage -> SendChannelMessage -> Bool
$c/= :: SendChannelMessage -> SendChannelMessage -> Bool
== :: SendChannelMessage -> SendChannelMessage -> Bool
$c== :: SendChannelMessage -> SendChannelMessage -> Bool
Prelude.Eq, Int -> SendChannelMessage -> ShowS
[SendChannelMessage] -> ShowS
SendChannelMessage -> String
(Int -> SendChannelMessage -> ShowS)
-> (SendChannelMessage -> String)
-> ([SendChannelMessage] -> ShowS)
-> Show SendChannelMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendChannelMessage] -> ShowS
$cshowList :: [SendChannelMessage] -> ShowS
show :: SendChannelMessage -> String
$cshow :: SendChannelMessage -> String
showsPrec :: Int -> SendChannelMessage -> ShowS
$cshowsPrec :: Int -> SendChannelMessage -> ShowS
Prelude.Show, (forall x. SendChannelMessage -> Rep SendChannelMessage x)
-> (forall x. Rep SendChannelMessage x -> SendChannelMessage)
-> Generic SendChannelMessage
forall x. Rep SendChannelMessage x -> SendChannelMessage
forall x. SendChannelMessage -> Rep SendChannelMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendChannelMessage x -> SendChannelMessage
$cfrom :: forall x. SendChannelMessage -> Rep SendChannelMessage x
Prelude.Generic)
newSendChannelMessage ::
Prelude.Text ->
Prelude.Text ->
ChannelMessageType ->
ChannelMessagePersistenceType ->
Prelude.Text ->
Prelude.Text ->
SendChannelMessage
newSendChannelMessage :: Text
-> Text
-> ChannelMessageType
-> ChannelMessagePersistenceType
-> Text
-> Text
-> SendChannelMessage
newSendChannelMessage
Text
pChannelArn_
Text
pContent_
ChannelMessageType
pType_
ChannelMessagePersistenceType
pPersistence_
Text
pClientRequestToken_
Text
pChimeBearer_ =
SendChannelMessage' :: Maybe (Sensitive Text)
-> Text
-> Sensitive Text
-> ChannelMessageType
-> ChannelMessagePersistenceType
-> Sensitive Text
-> Text
-> SendChannelMessage
SendChannelMessage'
{ $sel:metadata:SendChannelMessage' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:SendChannelMessage' :: Text
channelArn = Text
pChannelArn_,
$sel:content:SendChannelMessage' :: Sensitive Text
content = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pContent_,
$sel:type':SendChannelMessage' :: ChannelMessageType
type' = ChannelMessageType
pType_,
$sel:persistence:SendChannelMessage' :: ChannelMessagePersistenceType
persistence = ChannelMessagePersistenceType
pPersistence_,
$sel:clientRequestToken:SendChannelMessage' :: Sensitive Text
clientRequestToken =
Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pClientRequestToken_,
$sel:chimeBearer:SendChannelMessage' :: Text
chimeBearer = Text
pChimeBearer_
}
sendChannelMessage_metadata :: Lens.Lens' SendChannelMessage (Prelude.Maybe Prelude.Text)
sendChannelMessage_metadata :: (Maybe Text -> f (Maybe Text))
-> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_metadata = (SendChannelMessage -> Maybe (Sensitive Text))
-> (SendChannelMessage
-> Maybe (Sensitive Text) -> SendChannelMessage)
-> Lens
SendChannelMessage
SendChannelMessage
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:SendChannelMessage' :: SendChannelMessage -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: SendChannelMessage
s@SendChannelMessage' {} Maybe (Sensitive Text)
a -> SendChannelMessage
s {$sel:metadata:SendChannelMessage' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: SendChannelMessage) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> SendChannelMessage -> f SendChannelMessage)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SendChannelMessage
-> f SendChannelMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
sendChannelMessage_channelArn :: Lens.Lens' SendChannelMessage Prelude.Text
sendChannelMessage_channelArn :: (Text -> f Text) -> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_channelArn = (SendChannelMessage -> Text)
-> (SendChannelMessage -> Text -> SendChannelMessage)
-> Lens SendChannelMessage SendChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {Text
channelArn :: Text
$sel:channelArn:SendChannelMessage' :: SendChannelMessage -> Text
channelArn} -> Text
channelArn) (\s :: SendChannelMessage
s@SendChannelMessage' {} Text
a -> SendChannelMessage
s {$sel:channelArn:SendChannelMessage' :: Text
channelArn = Text
a} :: SendChannelMessage)
sendChannelMessage_content :: Lens.Lens' SendChannelMessage Prelude.Text
sendChannelMessage_content :: (Text -> f Text) -> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_content = (SendChannelMessage -> Sensitive Text)
-> (SendChannelMessage -> Sensitive Text -> SendChannelMessage)
-> Lens
SendChannelMessage
SendChannelMessage
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {Sensitive Text
content :: Sensitive Text
$sel:content:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
content} -> Sensitive Text
content) (\s :: SendChannelMessage
s@SendChannelMessage' {} Sensitive Text
a -> SendChannelMessage
s {$sel:content:SendChannelMessage' :: Sensitive Text
content = Sensitive Text
a} :: SendChannelMessage) ((Sensitive Text -> f (Sensitive Text))
-> SendChannelMessage -> f SendChannelMessage)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SendChannelMessage
-> f SendChannelMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
sendChannelMessage_type :: Lens.Lens' SendChannelMessage ChannelMessageType
sendChannelMessage_type :: (ChannelMessageType -> f ChannelMessageType)
-> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_type = (SendChannelMessage -> ChannelMessageType)
-> (SendChannelMessage -> ChannelMessageType -> SendChannelMessage)
-> Lens
SendChannelMessage
SendChannelMessage
ChannelMessageType
ChannelMessageType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {ChannelMessageType
type' :: ChannelMessageType
$sel:type':SendChannelMessage' :: SendChannelMessage -> ChannelMessageType
type'} -> ChannelMessageType
type') (\s :: SendChannelMessage
s@SendChannelMessage' {} ChannelMessageType
a -> SendChannelMessage
s {$sel:type':SendChannelMessage' :: ChannelMessageType
type' = ChannelMessageType
a} :: SendChannelMessage)
sendChannelMessage_persistence :: Lens.Lens' SendChannelMessage ChannelMessagePersistenceType
sendChannelMessage_persistence :: (ChannelMessagePersistenceType -> f ChannelMessagePersistenceType)
-> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_persistence = (SendChannelMessage -> ChannelMessagePersistenceType)
-> (SendChannelMessage
-> ChannelMessagePersistenceType -> SendChannelMessage)
-> Lens
SendChannelMessage
SendChannelMessage
ChannelMessagePersistenceType
ChannelMessagePersistenceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {ChannelMessagePersistenceType
persistence :: ChannelMessagePersistenceType
$sel:persistence:SendChannelMessage' :: SendChannelMessage -> ChannelMessagePersistenceType
persistence} -> ChannelMessagePersistenceType
persistence) (\s :: SendChannelMessage
s@SendChannelMessage' {} ChannelMessagePersistenceType
a -> SendChannelMessage
s {$sel:persistence:SendChannelMessage' :: ChannelMessagePersistenceType
persistence = ChannelMessagePersistenceType
a} :: SendChannelMessage)
sendChannelMessage_clientRequestToken :: Lens.Lens' SendChannelMessage Prelude.Text
sendChannelMessage_clientRequestToken :: (Text -> f Text) -> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_clientRequestToken = (SendChannelMessage -> Sensitive Text)
-> (SendChannelMessage -> Sensitive Text -> SendChannelMessage)
-> Lens
SendChannelMessage
SendChannelMessage
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {Sensitive Text
clientRequestToken :: Sensitive Text
$sel:clientRequestToken:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
clientRequestToken} -> Sensitive Text
clientRequestToken) (\s :: SendChannelMessage
s@SendChannelMessage' {} Sensitive Text
a -> SendChannelMessage
s {$sel:clientRequestToken:SendChannelMessage' :: Sensitive Text
clientRequestToken = Sensitive Text
a} :: SendChannelMessage) ((Sensitive Text -> f (Sensitive Text))
-> SendChannelMessage -> f SendChannelMessage)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SendChannelMessage
-> f SendChannelMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
sendChannelMessage_chimeBearer :: Lens.Lens' SendChannelMessage Prelude.Text
sendChannelMessage_chimeBearer :: (Text -> f Text) -> SendChannelMessage -> f SendChannelMessage
sendChannelMessage_chimeBearer = (SendChannelMessage -> Text)
-> (SendChannelMessage -> Text -> SendChannelMessage)
-> Lens SendChannelMessage SendChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessage' {Text
chimeBearer :: Text
$sel:chimeBearer:SendChannelMessage' :: SendChannelMessage -> Text
chimeBearer} -> Text
chimeBearer) (\s :: SendChannelMessage
s@SendChannelMessage' {} Text
a -> SendChannelMessage
s {$sel:chimeBearer:SendChannelMessage' :: Text
chimeBearer = Text
a} :: SendChannelMessage)
instance Core.AWSRequest SendChannelMessage where
type
AWSResponse SendChannelMessage =
SendChannelMessageResponse
request :: SendChannelMessage -> Request SendChannelMessage
request = Service -> SendChannelMessage -> Request SendChannelMessage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendChannelMessage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendChannelMessage)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SendChannelMessage))
-> Logger
-> Service
-> Proxy SendChannelMessage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendChannelMessage)))
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
-> Maybe Text -> Maybe Text -> Int -> SendChannelMessageResponse
SendChannelMessageResponse'
(Maybe ChannelMessageStatusStructure
-> Maybe Text -> Maybe Text -> Int -> SendChannelMessageResponse)
-> Either String (Maybe ChannelMessageStatusStructure)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> SendChannelMessageResponse)
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
(Maybe Text -> Maybe Text -> Int -> SendChannelMessageResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> SendChannelMessageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelArn")
Either String (Maybe Text -> Int -> SendChannelMessageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SendChannelMessageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MessageId")
Either String (Int -> SendChannelMessageResponse)
-> Either String Int -> Either String SendChannelMessageResponse
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 SendChannelMessage
instance Prelude.NFData SendChannelMessage
instance Core.ToHeaders SendChannelMessage where
toHeaders :: SendChannelMessage -> ResponseHeaders
toHeaders SendChannelMessage' {Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMessagePersistenceType
ChannelMessageType
chimeBearer :: Text
clientRequestToken :: Sensitive Text
persistence :: ChannelMessagePersistenceType
type' :: ChannelMessageType
content :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:SendChannelMessage' :: SendChannelMessage -> Text
$sel:clientRequestToken:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
$sel:persistence:SendChannelMessage' :: SendChannelMessage -> ChannelMessagePersistenceType
$sel:type':SendChannelMessage' :: SendChannelMessage -> ChannelMessageType
$sel:content:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
$sel:channelArn:SendChannelMessage' :: SendChannelMessage -> Text
$sel:metadata:SendChannelMessage' :: SendChannelMessage -> Maybe (Sensitive 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.ToJSON SendChannelMessage where
toJSON :: SendChannelMessage -> Value
toJSON SendChannelMessage' {Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMessagePersistenceType
ChannelMessageType
chimeBearer :: Text
clientRequestToken :: Sensitive Text
persistence :: ChannelMessagePersistenceType
type' :: ChannelMessageType
content :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:SendChannelMessage' :: SendChannelMessage -> Text
$sel:clientRequestToken:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
$sel:persistence:SendChannelMessage' :: SendChannelMessage -> ChannelMessagePersistenceType
$sel:type':SendChannelMessage' :: SendChannelMessage -> ChannelMessageType
$sel:content:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
$sel:channelArn:SendChannelMessage' :: SendChannelMessage -> Text
$sel:metadata:SendChannelMessage' :: SendChannelMessage -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Metadata" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
metadata,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
content),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> ChannelMessageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChannelMessageType
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Persistence" Text -> ChannelMessagePersistenceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChannelMessagePersistenceType
persistence),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ClientRequestToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientRequestToken)
]
)
instance Core.ToPath SendChannelMessage where
toPath :: SendChannelMessage -> ByteString
toPath SendChannelMessage' {Maybe (Sensitive Text)
Text
Sensitive Text
ChannelMessagePersistenceType
ChannelMessageType
chimeBearer :: Text
clientRequestToken :: Sensitive Text
persistence :: ChannelMessagePersistenceType
type' :: ChannelMessageType
content :: Sensitive Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
$sel:chimeBearer:SendChannelMessage' :: SendChannelMessage -> Text
$sel:clientRequestToken:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
$sel:persistence:SendChannelMessage' :: SendChannelMessage -> ChannelMessagePersistenceType
$sel:type':SendChannelMessage' :: SendChannelMessage -> ChannelMessageType
$sel:content:SendChannelMessage' :: SendChannelMessage -> Sensitive Text
$sel:channelArn:SendChannelMessage' :: SendChannelMessage -> Text
$sel:metadata:SendChannelMessage' :: SendChannelMessage -> Maybe (Sensitive 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"]
instance Core.ToQuery SendChannelMessage where
toQuery :: SendChannelMessage -> QueryString
toQuery = QueryString -> SendChannelMessage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendChannelMessageResponse = SendChannelMessageResponse'
{
SendChannelMessageResponse -> Maybe ChannelMessageStatusStructure
status :: Prelude.Maybe ChannelMessageStatusStructure,
SendChannelMessageResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
SendChannelMessageResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
SendChannelMessageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendChannelMessageResponse -> SendChannelMessageResponse -> Bool
(SendChannelMessageResponse -> SendChannelMessageResponse -> Bool)
-> (SendChannelMessageResponse
-> SendChannelMessageResponse -> Bool)
-> Eq SendChannelMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendChannelMessageResponse -> SendChannelMessageResponse -> Bool
$c/= :: SendChannelMessageResponse -> SendChannelMessageResponse -> Bool
== :: SendChannelMessageResponse -> SendChannelMessageResponse -> Bool
$c== :: SendChannelMessageResponse -> SendChannelMessageResponse -> Bool
Prelude.Eq, ReadPrec [SendChannelMessageResponse]
ReadPrec SendChannelMessageResponse
Int -> ReadS SendChannelMessageResponse
ReadS [SendChannelMessageResponse]
(Int -> ReadS SendChannelMessageResponse)
-> ReadS [SendChannelMessageResponse]
-> ReadPrec SendChannelMessageResponse
-> ReadPrec [SendChannelMessageResponse]
-> Read SendChannelMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendChannelMessageResponse]
$creadListPrec :: ReadPrec [SendChannelMessageResponse]
readPrec :: ReadPrec SendChannelMessageResponse
$creadPrec :: ReadPrec SendChannelMessageResponse
readList :: ReadS [SendChannelMessageResponse]
$creadList :: ReadS [SendChannelMessageResponse]
readsPrec :: Int -> ReadS SendChannelMessageResponse
$creadsPrec :: Int -> ReadS SendChannelMessageResponse
Prelude.Read, Int -> SendChannelMessageResponse -> ShowS
[SendChannelMessageResponse] -> ShowS
SendChannelMessageResponse -> String
(Int -> SendChannelMessageResponse -> ShowS)
-> (SendChannelMessageResponse -> String)
-> ([SendChannelMessageResponse] -> ShowS)
-> Show SendChannelMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendChannelMessageResponse] -> ShowS
$cshowList :: [SendChannelMessageResponse] -> ShowS
show :: SendChannelMessageResponse -> String
$cshow :: SendChannelMessageResponse -> String
showsPrec :: Int -> SendChannelMessageResponse -> ShowS
$cshowsPrec :: Int -> SendChannelMessageResponse -> ShowS
Prelude.Show, (forall x.
SendChannelMessageResponse -> Rep SendChannelMessageResponse x)
-> (forall x.
Rep SendChannelMessageResponse x -> SendChannelMessageResponse)
-> Generic SendChannelMessageResponse
forall x.
Rep SendChannelMessageResponse x -> SendChannelMessageResponse
forall x.
SendChannelMessageResponse -> Rep SendChannelMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendChannelMessageResponse x -> SendChannelMessageResponse
$cfrom :: forall x.
SendChannelMessageResponse -> Rep SendChannelMessageResponse x
Prelude.Generic)
newSendChannelMessageResponse ::
Prelude.Int ->
SendChannelMessageResponse
newSendChannelMessageResponse :: Int -> SendChannelMessageResponse
newSendChannelMessageResponse Int
pHttpStatus_ =
SendChannelMessageResponse' :: Maybe ChannelMessageStatusStructure
-> Maybe Text -> Maybe Text -> Int -> SendChannelMessageResponse
SendChannelMessageResponse'
{ $sel:status:SendChannelMessageResponse' :: Maybe ChannelMessageStatusStructure
status =
Maybe ChannelMessageStatusStructure
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:SendChannelMessageResponse' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageId:SendChannelMessageResponse' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SendChannelMessageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
sendChannelMessageResponse_status :: Lens.Lens' SendChannelMessageResponse (Prelude.Maybe ChannelMessageStatusStructure)
sendChannelMessageResponse_status :: (Maybe ChannelMessageStatusStructure
-> f (Maybe ChannelMessageStatusStructure))
-> SendChannelMessageResponse -> f SendChannelMessageResponse
sendChannelMessageResponse_status = (SendChannelMessageResponse -> Maybe ChannelMessageStatusStructure)
-> (SendChannelMessageResponse
-> Maybe ChannelMessageStatusStructure
-> SendChannelMessageResponse)
-> Lens
SendChannelMessageResponse
SendChannelMessageResponse
(Maybe ChannelMessageStatusStructure)
(Maybe ChannelMessageStatusStructure)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessageResponse' {Maybe ChannelMessageStatusStructure
status :: Maybe ChannelMessageStatusStructure
$sel:status:SendChannelMessageResponse' :: SendChannelMessageResponse -> Maybe ChannelMessageStatusStructure
status} -> Maybe ChannelMessageStatusStructure
status) (\s :: SendChannelMessageResponse
s@SendChannelMessageResponse' {} Maybe ChannelMessageStatusStructure
a -> SendChannelMessageResponse
s {$sel:status:SendChannelMessageResponse' :: Maybe ChannelMessageStatusStructure
status = Maybe ChannelMessageStatusStructure
a} :: SendChannelMessageResponse)
sendChannelMessageResponse_channelArn :: Lens.Lens' SendChannelMessageResponse (Prelude.Maybe Prelude.Text)
sendChannelMessageResponse_channelArn :: (Maybe Text -> f (Maybe Text))
-> SendChannelMessageResponse -> f SendChannelMessageResponse
sendChannelMessageResponse_channelArn = (SendChannelMessageResponse -> Maybe Text)
-> (SendChannelMessageResponse
-> Maybe Text -> SendChannelMessageResponse)
-> Lens
SendChannelMessageResponse
SendChannelMessageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessageResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:SendChannelMessageResponse' :: SendChannelMessageResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: SendChannelMessageResponse
s@SendChannelMessageResponse' {} Maybe Text
a -> SendChannelMessageResponse
s {$sel:channelArn:SendChannelMessageResponse' :: Maybe Text
channelArn = Maybe Text
a} :: SendChannelMessageResponse)
sendChannelMessageResponse_messageId :: Lens.Lens' SendChannelMessageResponse (Prelude.Maybe Prelude.Text)
sendChannelMessageResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> SendChannelMessageResponse -> f SendChannelMessageResponse
sendChannelMessageResponse_messageId = (SendChannelMessageResponse -> Maybe Text)
-> (SendChannelMessageResponse
-> Maybe Text -> SendChannelMessageResponse)
-> Lens
SendChannelMessageResponse
SendChannelMessageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessageResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:SendChannelMessageResponse' :: SendChannelMessageResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: SendChannelMessageResponse
s@SendChannelMessageResponse' {} Maybe Text
a -> SendChannelMessageResponse
s {$sel:messageId:SendChannelMessageResponse' :: Maybe Text
messageId = Maybe Text
a} :: SendChannelMessageResponse)
sendChannelMessageResponse_httpStatus :: Lens.Lens' SendChannelMessageResponse Prelude.Int
sendChannelMessageResponse_httpStatus :: (Int -> f Int)
-> SendChannelMessageResponse -> f SendChannelMessageResponse
sendChannelMessageResponse_httpStatus = (SendChannelMessageResponse -> Int)
-> (SendChannelMessageResponse
-> Int -> SendChannelMessageResponse)
-> Lens
SendChannelMessageResponse SendChannelMessageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendChannelMessageResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendChannelMessageResponse' :: SendChannelMessageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendChannelMessageResponse
s@SendChannelMessageResponse' {} Int
a -> SendChannelMessageResponse
s {$sel:httpStatus:SendChannelMessageResponse' :: Int
httpStatus = Int
a} :: SendChannelMessageResponse)
instance Prelude.NFData SendChannelMessageResponse