{-# 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.RedactChannelMessage
(
RedactChannelMessage (..),
newRedactChannelMessage,
redactChannelMessage_chimeBearer,
redactChannelMessage_channelArn,
redactChannelMessage_messageId,
RedactChannelMessageResponse (..),
newRedactChannelMessageResponse,
redactChannelMessageResponse_channelArn,
redactChannelMessageResponse_messageId,
redactChannelMessageResponse_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 RedactChannelMessage = RedactChannelMessage'
{
RedactChannelMessage -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
RedactChannelMessage -> Text
channelArn :: Prelude.Text,
RedactChannelMessage -> Text
messageId :: Prelude.Text
}
deriving (RedactChannelMessage -> RedactChannelMessage -> Bool
(RedactChannelMessage -> RedactChannelMessage -> Bool)
-> (RedactChannelMessage -> RedactChannelMessage -> Bool)
-> Eq RedactChannelMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedactChannelMessage -> RedactChannelMessage -> Bool
$c/= :: RedactChannelMessage -> RedactChannelMessage -> Bool
== :: RedactChannelMessage -> RedactChannelMessage -> Bool
$c== :: RedactChannelMessage -> RedactChannelMessage -> Bool
Prelude.Eq, ReadPrec [RedactChannelMessage]
ReadPrec RedactChannelMessage
Int -> ReadS RedactChannelMessage
ReadS [RedactChannelMessage]
(Int -> ReadS RedactChannelMessage)
-> ReadS [RedactChannelMessage]
-> ReadPrec RedactChannelMessage
-> ReadPrec [RedactChannelMessage]
-> Read RedactChannelMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedactChannelMessage]
$creadListPrec :: ReadPrec [RedactChannelMessage]
readPrec :: ReadPrec RedactChannelMessage
$creadPrec :: ReadPrec RedactChannelMessage
readList :: ReadS [RedactChannelMessage]
$creadList :: ReadS [RedactChannelMessage]
readsPrec :: Int -> ReadS RedactChannelMessage
$creadsPrec :: Int -> ReadS RedactChannelMessage
Prelude.Read, Int -> RedactChannelMessage -> ShowS
[RedactChannelMessage] -> ShowS
RedactChannelMessage -> String
(Int -> RedactChannelMessage -> ShowS)
-> (RedactChannelMessage -> String)
-> ([RedactChannelMessage] -> ShowS)
-> Show RedactChannelMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedactChannelMessage] -> ShowS
$cshowList :: [RedactChannelMessage] -> ShowS
show :: RedactChannelMessage -> String
$cshow :: RedactChannelMessage -> String
showsPrec :: Int -> RedactChannelMessage -> ShowS
$cshowsPrec :: Int -> RedactChannelMessage -> ShowS
Prelude.Show, (forall x. RedactChannelMessage -> Rep RedactChannelMessage x)
-> (forall x. Rep RedactChannelMessage x -> RedactChannelMessage)
-> Generic RedactChannelMessage
forall x. Rep RedactChannelMessage x -> RedactChannelMessage
forall x. RedactChannelMessage -> Rep RedactChannelMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedactChannelMessage x -> RedactChannelMessage
$cfrom :: forall x. RedactChannelMessage -> Rep RedactChannelMessage x
Prelude.Generic)
newRedactChannelMessage ::
Prelude.Text ->
Prelude.Text ->
RedactChannelMessage
newRedactChannelMessage :: Text -> Text -> RedactChannelMessage
newRedactChannelMessage Text
pChannelArn_ Text
pMessageId_ =
RedactChannelMessage' :: Maybe Text -> Text -> Text -> RedactChannelMessage
RedactChannelMessage'
{ $sel:chimeBearer:RedactChannelMessage' :: Maybe Text
chimeBearer =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:RedactChannelMessage' :: Text
channelArn = Text
pChannelArn_,
$sel:messageId:RedactChannelMessage' :: Text
messageId = Text
pMessageId_
}
redactChannelMessage_chimeBearer :: Lens.Lens' RedactChannelMessage (Prelude.Maybe Prelude.Text)
redactChannelMessage_chimeBearer :: (Maybe Text -> f (Maybe Text))
-> RedactChannelMessage -> f RedactChannelMessage
redactChannelMessage_chimeBearer = (RedactChannelMessage -> Maybe Text)
-> (RedactChannelMessage -> Maybe Text -> RedactChannelMessage)
-> Lens
RedactChannelMessage RedactChannelMessage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactChannelMessage' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:RedactChannelMessage' :: RedactChannelMessage -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: RedactChannelMessage
s@RedactChannelMessage' {} Maybe Text
a -> RedactChannelMessage
s {$sel:chimeBearer:RedactChannelMessage' :: Maybe Text
chimeBearer = Maybe Text
a} :: RedactChannelMessage)
redactChannelMessage_channelArn :: Lens.Lens' RedactChannelMessage Prelude.Text
redactChannelMessage_channelArn :: (Text -> f Text) -> RedactChannelMessage -> f RedactChannelMessage
redactChannelMessage_channelArn = (RedactChannelMessage -> Text)
-> (RedactChannelMessage -> Text -> RedactChannelMessage)
-> Lens RedactChannelMessage RedactChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactChannelMessage' {Text
channelArn :: Text
$sel:channelArn:RedactChannelMessage' :: RedactChannelMessage -> Text
channelArn} -> Text
channelArn) (\s :: RedactChannelMessage
s@RedactChannelMessage' {} Text
a -> RedactChannelMessage
s {$sel:channelArn:RedactChannelMessage' :: Text
channelArn = Text
a} :: RedactChannelMessage)
redactChannelMessage_messageId :: Lens.Lens' RedactChannelMessage Prelude.Text
redactChannelMessage_messageId :: (Text -> f Text) -> RedactChannelMessage -> f RedactChannelMessage
redactChannelMessage_messageId = (RedactChannelMessage -> Text)
-> (RedactChannelMessage -> Text -> RedactChannelMessage)
-> Lens RedactChannelMessage RedactChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactChannelMessage' {Text
messageId :: Text
$sel:messageId:RedactChannelMessage' :: RedactChannelMessage -> Text
messageId} -> Text
messageId) (\s :: RedactChannelMessage
s@RedactChannelMessage' {} Text
a -> RedactChannelMessage
s {$sel:messageId:RedactChannelMessage' :: Text
messageId = Text
a} :: RedactChannelMessage)
instance Core.AWSRequest RedactChannelMessage where
type
AWSResponse RedactChannelMessage =
RedactChannelMessageResponse
request :: RedactChannelMessage -> Request RedactChannelMessage
request = Service -> RedactChannelMessage -> Request RedactChannelMessage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RedactChannelMessage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RedactChannelMessage)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RedactChannelMessage))
-> Logger
-> Service
-> Proxy RedactChannelMessage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RedactChannelMessage)))
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 Text -> Maybe Text -> Int -> RedactChannelMessageResponse
RedactChannelMessageResponse'
(Maybe Text -> Maybe Text -> Int -> RedactChannelMessageResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> RedactChannelMessageResponse)
forall (f :: * -> *) a b. Functor 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 -> RedactChannelMessageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RedactChannelMessageResponse)
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 -> RedactChannelMessageResponse)
-> Either String Int -> Either String RedactChannelMessageResponse
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 RedactChannelMessage
instance Prelude.NFData RedactChannelMessage
instance Core.ToHeaders RedactChannelMessage where
toHeaders :: RedactChannelMessage -> ResponseHeaders
toHeaders RedactChannelMessage' {Maybe Text
Text
messageId :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:messageId:RedactChannelMessage' :: RedactChannelMessage -> Text
$sel:channelArn:RedactChannelMessage' :: RedactChannelMessage -> Text
$sel:chimeBearer:RedactChannelMessage' :: RedactChannelMessage -> Maybe Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
chimeBearer]
instance Core.ToJSON RedactChannelMessage where
toJSON :: RedactChannelMessage -> Value
toJSON = Value -> RedactChannelMessage -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath RedactChannelMessage where
toPath :: RedactChannelMessage -> ByteString
toPath RedactChannelMessage' {Maybe Text
Text
messageId :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:messageId:RedactChannelMessage' :: RedactChannelMessage -> Text
$sel:channelArn:RedactChannelMessage' :: RedactChannelMessage -> Text
$sel:chimeBearer:RedactChannelMessage' :: RedactChannelMessage -> Maybe 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 RedactChannelMessage where
toQuery :: RedactChannelMessage -> QueryString
toQuery =
QueryString -> RedactChannelMessage -> QueryString
forall a b. a -> b -> a
Prelude.const
([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=redact"])
data RedactChannelMessageResponse = RedactChannelMessageResponse'
{
RedactChannelMessageResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
RedactChannelMessageResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
RedactChannelMessageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool
(RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool)
-> (RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool)
-> Eq RedactChannelMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool
$c/= :: RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool
== :: RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool
$c== :: RedactChannelMessageResponse
-> RedactChannelMessageResponse -> Bool
Prelude.Eq, ReadPrec [RedactChannelMessageResponse]
ReadPrec RedactChannelMessageResponse
Int -> ReadS RedactChannelMessageResponse
ReadS [RedactChannelMessageResponse]
(Int -> ReadS RedactChannelMessageResponse)
-> ReadS [RedactChannelMessageResponse]
-> ReadPrec RedactChannelMessageResponse
-> ReadPrec [RedactChannelMessageResponse]
-> Read RedactChannelMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedactChannelMessageResponse]
$creadListPrec :: ReadPrec [RedactChannelMessageResponse]
readPrec :: ReadPrec RedactChannelMessageResponse
$creadPrec :: ReadPrec RedactChannelMessageResponse
readList :: ReadS [RedactChannelMessageResponse]
$creadList :: ReadS [RedactChannelMessageResponse]
readsPrec :: Int -> ReadS RedactChannelMessageResponse
$creadsPrec :: Int -> ReadS RedactChannelMessageResponse
Prelude.Read, Int -> RedactChannelMessageResponse -> ShowS
[RedactChannelMessageResponse] -> ShowS
RedactChannelMessageResponse -> String
(Int -> RedactChannelMessageResponse -> ShowS)
-> (RedactChannelMessageResponse -> String)
-> ([RedactChannelMessageResponse] -> ShowS)
-> Show RedactChannelMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedactChannelMessageResponse] -> ShowS
$cshowList :: [RedactChannelMessageResponse] -> ShowS
show :: RedactChannelMessageResponse -> String
$cshow :: RedactChannelMessageResponse -> String
showsPrec :: Int -> RedactChannelMessageResponse -> ShowS
$cshowsPrec :: Int -> RedactChannelMessageResponse -> ShowS
Prelude.Show, (forall x.
RedactChannelMessageResponse -> Rep RedactChannelMessageResponse x)
-> (forall x.
Rep RedactChannelMessageResponse x -> RedactChannelMessageResponse)
-> Generic RedactChannelMessageResponse
forall x.
Rep RedactChannelMessageResponse x -> RedactChannelMessageResponse
forall x.
RedactChannelMessageResponse -> Rep RedactChannelMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedactChannelMessageResponse x -> RedactChannelMessageResponse
$cfrom :: forall x.
RedactChannelMessageResponse -> Rep RedactChannelMessageResponse x
Prelude.Generic)
newRedactChannelMessageResponse ::
Prelude.Int ->
RedactChannelMessageResponse
newRedactChannelMessageResponse :: Int -> RedactChannelMessageResponse
newRedactChannelMessageResponse Int
pHttpStatus_ =
RedactChannelMessageResponse' :: Maybe Text -> Maybe Text -> Int -> RedactChannelMessageResponse
RedactChannelMessageResponse'
{ $sel:channelArn:RedactChannelMessageResponse' :: Maybe Text
channelArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageId:RedactChannelMessageResponse' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RedactChannelMessageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
redactChannelMessageResponse_channelArn :: Lens.Lens' RedactChannelMessageResponse (Prelude.Maybe Prelude.Text)
redactChannelMessageResponse_channelArn :: (Maybe Text -> f (Maybe Text))
-> RedactChannelMessageResponse -> f RedactChannelMessageResponse
redactChannelMessageResponse_channelArn = (RedactChannelMessageResponse -> Maybe Text)
-> (RedactChannelMessageResponse
-> Maybe Text -> RedactChannelMessageResponse)
-> Lens
RedactChannelMessageResponse
RedactChannelMessageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactChannelMessageResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:RedactChannelMessageResponse' :: RedactChannelMessageResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: RedactChannelMessageResponse
s@RedactChannelMessageResponse' {} Maybe Text
a -> RedactChannelMessageResponse
s {$sel:channelArn:RedactChannelMessageResponse' :: Maybe Text
channelArn = Maybe Text
a} :: RedactChannelMessageResponse)
redactChannelMessageResponse_messageId :: Lens.Lens' RedactChannelMessageResponse (Prelude.Maybe Prelude.Text)
redactChannelMessageResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> RedactChannelMessageResponse -> f RedactChannelMessageResponse
redactChannelMessageResponse_messageId = (RedactChannelMessageResponse -> Maybe Text)
-> (RedactChannelMessageResponse
-> Maybe Text -> RedactChannelMessageResponse)
-> Lens
RedactChannelMessageResponse
RedactChannelMessageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactChannelMessageResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:RedactChannelMessageResponse' :: RedactChannelMessageResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: RedactChannelMessageResponse
s@RedactChannelMessageResponse' {} Maybe Text
a -> RedactChannelMessageResponse
s {$sel:messageId:RedactChannelMessageResponse' :: Maybe Text
messageId = Maybe Text
a} :: RedactChannelMessageResponse)
redactChannelMessageResponse_httpStatus :: Lens.Lens' RedactChannelMessageResponse Prelude.Int
redactChannelMessageResponse_httpStatus :: (Int -> f Int)
-> RedactChannelMessageResponse -> f RedactChannelMessageResponse
redactChannelMessageResponse_httpStatus = (RedactChannelMessageResponse -> Int)
-> (RedactChannelMessageResponse
-> Int -> RedactChannelMessageResponse)
-> Lens
RedactChannelMessageResponse RedactChannelMessageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactChannelMessageResponse' {Int
httpStatus :: Int
$sel:httpStatus:RedactChannelMessageResponse' :: RedactChannelMessageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RedactChannelMessageResponse
s@RedactChannelMessageResponse' {} Int
a -> RedactChannelMessageResponse
s {$sel:httpStatus:RedactChannelMessageResponse' :: Int
httpStatus = Int
a} :: RedactChannelMessageResponse)
instance Prelude.NFData RedactChannelMessageResponse