{-# 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.KinesisVideoSignaling.SendAlexaOfferToMaster
(
SendAlexaOfferToMaster (..),
newSendAlexaOfferToMaster,
sendAlexaOfferToMaster_channelARN,
sendAlexaOfferToMaster_senderClientId,
sendAlexaOfferToMaster_messagePayload,
SendAlexaOfferToMasterResponse (..),
newSendAlexaOfferToMasterResponse,
sendAlexaOfferToMasterResponse_answer,
sendAlexaOfferToMasterResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisVideoSignaling.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SendAlexaOfferToMaster = SendAlexaOfferToMaster'
{
SendAlexaOfferToMaster -> Text
channelARN :: Prelude.Text,
SendAlexaOfferToMaster -> Text
senderClientId :: Prelude.Text,
SendAlexaOfferToMaster -> Text
messagePayload :: Prelude.Text
}
deriving (SendAlexaOfferToMaster -> SendAlexaOfferToMaster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendAlexaOfferToMaster -> SendAlexaOfferToMaster -> Bool
$c/= :: SendAlexaOfferToMaster -> SendAlexaOfferToMaster -> Bool
== :: SendAlexaOfferToMaster -> SendAlexaOfferToMaster -> Bool
$c== :: SendAlexaOfferToMaster -> SendAlexaOfferToMaster -> Bool
Prelude.Eq, ReadPrec [SendAlexaOfferToMaster]
ReadPrec SendAlexaOfferToMaster
Int -> ReadS SendAlexaOfferToMaster
ReadS [SendAlexaOfferToMaster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendAlexaOfferToMaster]
$creadListPrec :: ReadPrec [SendAlexaOfferToMaster]
readPrec :: ReadPrec SendAlexaOfferToMaster
$creadPrec :: ReadPrec SendAlexaOfferToMaster
readList :: ReadS [SendAlexaOfferToMaster]
$creadList :: ReadS [SendAlexaOfferToMaster]
readsPrec :: Int -> ReadS SendAlexaOfferToMaster
$creadsPrec :: Int -> ReadS SendAlexaOfferToMaster
Prelude.Read, Int -> SendAlexaOfferToMaster -> ShowS
[SendAlexaOfferToMaster] -> ShowS
SendAlexaOfferToMaster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendAlexaOfferToMaster] -> ShowS
$cshowList :: [SendAlexaOfferToMaster] -> ShowS
show :: SendAlexaOfferToMaster -> String
$cshow :: SendAlexaOfferToMaster -> String
showsPrec :: Int -> SendAlexaOfferToMaster -> ShowS
$cshowsPrec :: Int -> SendAlexaOfferToMaster -> ShowS
Prelude.Show, forall x. Rep SendAlexaOfferToMaster x -> SendAlexaOfferToMaster
forall x. SendAlexaOfferToMaster -> Rep SendAlexaOfferToMaster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendAlexaOfferToMaster x -> SendAlexaOfferToMaster
$cfrom :: forall x. SendAlexaOfferToMaster -> Rep SendAlexaOfferToMaster x
Prelude.Generic)
newSendAlexaOfferToMaster ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
SendAlexaOfferToMaster
newSendAlexaOfferToMaster :: Text -> Text -> Text -> SendAlexaOfferToMaster
newSendAlexaOfferToMaster
Text
pChannelARN_
Text
pSenderClientId_
Text
pMessagePayload_ =
SendAlexaOfferToMaster'
{ $sel:channelARN:SendAlexaOfferToMaster' :: Text
channelARN = Text
pChannelARN_,
$sel:senderClientId:SendAlexaOfferToMaster' :: Text
senderClientId = Text
pSenderClientId_,
$sel:messagePayload:SendAlexaOfferToMaster' :: Text
messagePayload = Text
pMessagePayload_
}
sendAlexaOfferToMaster_channelARN :: Lens.Lens' SendAlexaOfferToMaster Prelude.Text
sendAlexaOfferToMaster_channelARN :: Lens' SendAlexaOfferToMaster Text
sendAlexaOfferToMaster_channelARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAlexaOfferToMaster' {Text
channelARN :: Text
$sel:channelARN:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
channelARN} -> Text
channelARN) (\s :: SendAlexaOfferToMaster
s@SendAlexaOfferToMaster' {} Text
a -> SendAlexaOfferToMaster
s {$sel:channelARN:SendAlexaOfferToMaster' :: Text
channelARN = Text
a} :: SendAlexaOfferToMaster)
sendAlexaOfferToMaster_senderClientId :: Lens.Lens' SendAlexaOfferToMaster Prelude.Text
sendAlexaOfferToMaster_senderClientId :: Lens' SendAlexaOfferToMaster Text
sendAlexaOfferToMaster_senderClientId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAlexaOfferToMaster' {Text
senderClientId :: Text
$sel:senderClientId:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
senderClientId} -> Text
senderClientId) (\s :: SendAlexaOfferToMaster
s@SendAlexaOfferToMaster' {} Text
a -> SendAlexaOfferToMaster
s {$sel:senderClientId:SendAlexaOfferToMaster' :: Text
senderClientId = Text
a} :: SendAlexaOfferToMaster)
sendAlexaOfferToMaster_messagePayload :: Lens.Lens' SendAlexaOfferToMaster Prelude.Text
sendAlexaOfferToMaster_messagePayload :: Lens' SendAlexaOfferToMaster Text
sendAlexaOfferToMaster_messagePayload = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAlexaOfferToMaster' {Text
messagePayload :: Text
$sel:messagePayload:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
messagePayload} -> Text
messagePayload) (\s :: SendAlexaOfferToMaster
s@SendAlexaOfferToMaster' {} Text
a -> SendAlexaOfferToMaster
s {$sel:messagePayload:SendAlexaOfferToMaster' :: Text
messagePayload = Text
a} :: SendAlexaOfferToMaster)
instance Core.AWSRequest SendAlexaOfferToMaster where
type
AWSResponse SendAlexaOfferToMaster =
SendAlexaOfferToMasterResponse
request :: (Service -> Service)
-> SendAlexaOfferToMaster -> Request SendAlexaOfferToMaster
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SendAlexaOfferToMaster
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendAlexaOfferToMaster)))
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 -> Int -> SendAlexaOfferToMasterResponse
SendAlexaOfferToMasterResponse'
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
"Answer")
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 SendAlexaOfferToMaster where
hashWithSalt :: Int -> SendAlexaOfferToMaster -> Int
hashWithSalt Int
_salt SendAlexaOfferToMaster' {Text
messagePayload :: Text
senderClientId :: Text
channelARN :: Text
$sel:messagePayload:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
$sel:senderClientId:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
$sel:channelARN:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
senderClientId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
messagePayload
instance Prelude.NFData SendAlexaOfferToMaster where
rnf :: SendAlexaOfferToMaster -> ()
rnf SendAlexaOfferToMaster' {Text
messagePayload :: Text
senderClientId :: Text
channelARN :: Text
$sel:messagePayload:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
$sel:senderClientId:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
$sel:channelARN:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
..} =
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
senderClientId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
messagePayload
instance Data.ToHeaders SendAlexaOfferToMaster where
toHeaders :: SendAlexaOfferToMaster -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON SendAlexaOfferToMaster where
toJSON :: SendAlexaOfferToMaster -> Value
toJSON SendAlexaOfferToMaster' {Text
messagePayload :: Text
senderClientId :: Text
channelARN :: Text
$sel:messagePayload:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
$sel:senderClientId:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
$sel:channelARN:SendAlexaOfferToMaster' :: SendAlexaOfferToMaster -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ChannelARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
channelARN),
forall a. a -> Maybe a
Prelude.Just
(Key
"SenderClientId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
senderClientId),
forall a. a -> Maybe a
Prelude.Just
(Key
"MessagePayload" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
messagePayload)
]
)
instance Data.ToPath SendAlexaOfferToMaster where
toPath :: SendAlexaOfferToMaster -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/send-alexa-offer-to-master"
instance Data.ToQuery SendAlexaOfferToMaster where
toQuery :: SendAlexaOfferToMaster -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data SendAlexaOfferToMasterResponse = SendAlexaOfferToMasterResponse'
{
SendAlexaOfferToMasterResponse -> Maybe Text
answer :: Prelude.Maybe Prelude.Text,
SendAlexaOfferToMasterResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendAlexaOfferToMasterResponse
-> SendAlexaOfferToMasterResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendAlexaOfferToMasterResponse
-> SendAlexaOfferToMasterResponse -> Bool
$c/= :: SendAlexaOfferToMasterResponse
-> SendAlexaOfferToMasterResponse -> Bool
== :: SendAlexaOfferToMasterResponse
-> SendAlexaOfferToMasterResponse -> Bool
$c== :: SendAlexaOfferToMasterResponse
-> SendAlexaOfferToMasterResponse -> Bool
Prelude.Eq, ReadPrec [SendAlexaOfferToMasterResponse]
ReadPrec SendAlexaOfferToMasterResponse
Int -> ReadS SendAlexaOfferToMasterResponse
ReadS [SendAlexaOfferToMasterResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendAlexaOfferToMasterResponse]
$creadListPrec :: ReadPrec [SendAlexaOfferToMasterResponse]
readPrec :: ReadPrec SendAlexaOfferToMasterResponse
$creadPrec :: ReadPrec SendAlexaOfferToMasterResponse
readList :: ReadS [SendAlexaOfferToMasterResponse]
$creadList :: ReadS [SendAlexaOfferToMasterResponse]
readsPrec :: Int -> ReadS SendAlexaOfferToMasterResponse
$creadsPrec :: Int -> ReadS SendAlexaOfferToMasterResponse
Prelude.Read, Int -> SendAlexaOfferToMasterResponse -> ShowS
[SendAlexaOfferToMasterResponse] -> ShowS
SendAlexaOfferToMasterResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendAlexaOfferToMasterResponse] -> ShowS
$cshowList :: [SendAlexaOfferToMasterResponse] -> ShowS
show :: SendAlexaOfferToMasterResponse -> String
$cshow :: SendAlexaOfferToMasterResponse -> String
showsPrec :: Int -> SendAlexaOfferToMasterResponse -> ShowS
$cshowsPrec :: Int -> SendAlexaOfferToMasterResponse -> ShowS
Prelude.Show, forall x.
Rep SendAlexaOfferToMasterResponse x
-> SendAlexaOfferToMasterResponse
forall x.
SendAlexaOfferToMasterResponse
-> Rep SendAlexaOfferToMasterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendAlexaOfferToMasterResponse x
-> SendAlexaOfferToMasterResponse
$cfrom :: forall x.
SendAlexaOfferToMasterResponse
-> Rep SendAlexaOfferToMasterResponse x
Prelude.Generic)
newSendAlexaOfferToMasterResponse ::
Prelude.Int ->
SendAlexaOfferToMasterResponse
newSendAlexaOfferToMasterResponse :: Int -> SendAlexaOfferToMasterResponse
newSendAlexaOfferToMasterResponse Int
pHttpStatus_ =
SendAlexaOfferToMasterResponse'
{ $sel:answer:SendAlexaOfferToMasterResponse' :: Maybe Text
answer =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SendAlexaOfferToMasterResponse' :: Int
httpStatus = Int
pHttpStatus_
}
sendAlexaOfferToMasterResponse_answer :: Lens.Lens' SendAlexaOfferToMasterResponse (Prelude.Maybe Prelude.Text)
sendAlexaOfferToMasterResponse_answer :: Lens' SendAlexaOfferToMasterResponse (Maybe Text)
sendAlexaOfferToMasterResponse_answer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAlexaOfferToMasterResponse' {Maybe Text
answer :: Maybe Text
$sel:answer:SendAlexaOfferToMasterResponse' :: SendAlexaOfferToMasterResponse -> Maybe Text
answer} -> Maybe Text
answer) (\s :: SendAlexaOfferToMasterResponse
s@SendAlexaOfferToMasterResponse' {} Maybe Text
a -> SendAlexaOfferToMasterResponse
s {$sel:answer:SendAlexaOfferToMasterResponse' :: Maybe Text
answer = Maybe Text
a} :: SendAlexaOfferToMasterResponse)
sendAlexaOfferToMasterResponse_httpStatus :: Lens.Lens' SendAlexaOfferToMasterResponse Prelude.Int
sendAlexaOfferToMasterResponse_httpStatus :: Lens' SendAlexaOfferToMasterResponse Int
sendAlexaOfferToMasterResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendAlexaOfferToMasterResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendAlexaOfferToMasterResponse' :: SendAlexaOfferToMasterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendAlexaOfferToMasterResponse
s@SendAlexaOfferToMasterResponse' {} Int
a -> SendAlexaOfferToMasterResponse
s {$sel:httpStatus:SendAlexaOfferToMasterResponse' :: Int
httpStatus = Int
a} :: SendAlexaOfferToMasterResponse)
instance
Prelude.NFData
SendAlexaOfferToMasterResponse
where
rnf :: SendAlexaOfferToMasterResponse -> ()
rnf SendAlexaOfferToMasterResponse' {Int
Maybe Text
httpStatus :: Int
answer :: Maybe Text
$sel:httpStatus:SendAlexaOfferToMasterResponse' :: SendAlexaOfferToMasterResponse -> Int
$sel:answer:SendAlexaOfferToMasterResponse' :: SendAlexaOfferToMasterResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
answer
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus