{-# 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.RedactConversationMessage
(
RedactConversationMessage (..),
newRedactConversationMessage,
redactConversationMessage_accountId,
redactConversationMessage_conversationId,
redactConversationMessage_messageId,
RedactConversationMessageResponse (..),
newRedactConversationMessageResponse,
redactConversationMessageResponse_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 RedactConversationMessage = RedactConversationMessage'
{
RedactConversationMessage -> Text
accountId :: Prelude.Text,
RedactConversationMessage -> Text
conversationId :: Prelude.Text,
RedactConversationMessage -> Text
messageId :: Prelude.Text
}
deriving (RedactConversationMessage -> RedactConversationMessage -> Bool
(RedactConversationMessage -> RedactConversationMessage -> Bool)
-> (RedactConversationMessage -> RedactConversationMessage -> Bool)
-> Eq RedactConversationMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedactConversationMessage -> RedactConversationMessage -> Bool
$c/= :: RedactConversationMessage -> RedactConversationMessage -> Bool
== :: RedactConversationMessage -> RedactConversationMessage -> Bool
$c== :: RedactConversationMessage -> RedactConversationMessage -> Bool
Prelude.Eq, ReadPrec [RedactConversationMessage]
ReadPrec RedactConversationMessage
Int -> ReadS RedactConversationMessage
ReadS [RedactConversationMessage]
(Int -> ReadS RedactConversationMessage)
-> ReadS [RedactConversationMessage]
-> ReadPrec RedactConversationMessage
-> ReadPrec [RedactConversationMessage]
-> Read RedactConversationMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedactConversationMessage]
$creadListPrec :: ReadPrec [RedactConversationMessage]
readPrec :: ReadPrec RedactConversationMessage
$creadPrec :: ReadPrec RedactConversationMessage
readList :: ReadS [RedactConversationMessage]
$creadList :: ReadS [RedactConversationMessage]
readsPrec :: Int -> ReadS RedactConversationMessage
$creadsPrec :: Int -> ReadS RedactConversationMessage
Prelude.Read, Int -> RedactConversationMessage -> ShowS
[RedactConversationMessage] -> ShowS
RedactConversationMessage -> String
(Int -> RedactConversationMessage -> ShowS)
-> (RedactConversationMessage -> String)
-> ([RedactConversationMessage] -> ShowS)
-> Show RedactConversationMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedactConversationMessage] -> ShowS
$cshowList :: [RedactConversationMessage] -> ShowS
show :: RedactConversationMessage -> String
$cshow :: RedactConversationMessage -> String
showsPrec :: Int -> RedactConversationMessage -> ShowS
$cshowsPrec :: Int -> RedactConversationMessage -> ShowS
Prelude.Show, (forall x.
RedactConversationMessage -> Rep RedactConversationMessage x)
-> (forall x.
Rep RedactConversationMessage x -> RedactConversationMessage)
-> Generic RedactConversationMessage
forall x.
Rep RedactConversationMessage x -> RedactConversationMessage
forall x.
RedactConversationMessage -> Rep RedactConversationMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedactConversationMessage x -> RedactConversationMessage
$cfrom :: forall x.
RedactConversationMessage -> Rep RedactConversationMessage x
Prelude.Generic)
newRedactConversationMessage ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
RedactConversationMessage
newRedactConversationMessage :: Text -> Text -> Text -> RedactConversationMessage
newRedactConversationMessage
Text
pAccountId_
Text
pConversationId_
Text
pMessageId_ =
RedactConversationMessage' :: Text -> Text -> Text -> RedactConversationMessage
RedactConversationMessage'
{ $sel:accountId:RedactConversationMessage' :: Text
accountId = Text
pAccountId_,
$sel:conversationId:RedactConversationMessage' :: Text
conversationId = Text
pConversationId_,
$sel:messageId:RedactConversationMessage' :: Text
messageId = Text
pMessageId_
}
redactConversationMessage_accountId :: Lens.Lens' RedactConversationMessage Prelude.Text
redactConversationMessage_accountId :: (Text -> f Text)
-> RedactConversationMessage -> f RedactConversationMessage
redactConversationMessage_accountId = (RedactConversationMessage -> Text)
-> (RedactConversationMessage -> Text -> RedactConversationMessage)
-> Lens
RedactConversationMessage RedactConversationMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactConversationMessage' {Text
accountId :: Text
$sel:accountId:RedactConversationMessage' :: RedactConversationMessage -> Text
accountId} -> Text
accountId) (\s :: RedactConversationMessage
s@RedactConversationMessage' {} Text
a -> RedactConversationMessage
s {$sel:accountId:RedactConversationMessage' :: Text
accountId = Text
a} :: RedactConversationMessage)
redactConversationMessage_conversationId :: Lens.Lens' RedactConversationMessage Prelude.Text
redactConversationMessage_conversationId :: (Text -> f Text)
-> RedactConversationMessage -> f RedactConversationMessage
redactConversationMessage_conversationId = (RedactConversationMessage -> Text)
-> (RedactConversationMessage -> Text -> RedactConversationMessage)
-> Lens
RedactConversationMessage RedactConversationMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactConversationMessage' {Text
conversationId :: Text
$sel:conversationId:RedactConversationMessage' :: RedactConversationMessage -> Text
conversationId} -> Text
conversationId) (\s :: RedactConversationMessage
s@RedactConversationMessage' {} Text
a -> RedactConversationMessage
s {$sel:conversationId:RedactConversationMessage' :: Text
conversationId = Text
a} :: RedactConversationMessage)
redactConversationMessage_messageId :: Lens.Lens' RedactConversationMessage Prelude.Text
redactConversationMessage_messageId :: (Text -> f Text)
-> RedactConversationMessage -> f RedactConversationMessage
redactConversationMessage_messageId = (RedactConversationMessage -> Text)
-> (RedactConversationMessage -> Text -> RedactConversationMessage)
-> Lens
RedactConversationMessage RedactConversationMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactConversationMessage' {Text
messageId :: Text
$sel:messageId:RedactConversationMessage' :: RedactConversationMessage -> Text
messageId} -> Text
messageId) (\s :: RedactConversationMessage
s@RedactConversationMessage' {} Text
a -> RedactConversationMessage
s {$sel:messageId:RedactConversationMessage' :: Text
messageId = Text
a} :: RedactConversationMessage)
instance Core.AWSRequest RedactConversationMessage where
type
AWSResponse RedactConversationMessage =
RedactConversationMessageResponse
request :: RedactConversationMessage -> Request RedactConversationMessage
request = Service
-> RedactConversationMessage -> Request RedactConversationMessage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RedactConversationMessage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RedactConversationMessage)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse RedactConversationMessage))
-> Logger
-> Service
-> Proxy RedactConversationMessage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RedactConversationMessage)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> RedactConversationMessageResponse
RedactConversationMessageResponse'
(Int -> RedactConversationMessageResponse)
-> Either String Int
-> Either String RedactConversationMessageResponse
forall (f :: * -> *) a b. Functor 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 RedactConversationMessage
instance Prelude.NFData RedactConversationMessage
instance Core.ToHeaders RedactConversationMessage where
toHeaders :: RedactConversationMessage -> ResponseHeaders
toHeaders = ResponseHeaders -> RedactConversationMessage -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON RedactConversationMessage where
toJSON :: RedactConversationMessage -> Value
toJSON = Value -> RedactConversationMessage -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath RedactConversationMessage where
toPath :: RedactConversationMessage -> ByteString
toPath RedactConversationMessage' {Text
messageId :: Text
conversationId :: Text
accountId :: Text
$sel:messageId:RedactConversationMessage' :: RedactConversationMessage -> Text
$sel:conversationId:RedactConversationMessage' :: RedactConversationMessage -> Text
$sel:accountId:RedactConversationMessage' :: RedactConversationMessage -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
accountId,
ByteString
"/conversations/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
conversationId,
ByteString
"/messages/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
messageId
]
instance Core.ToQuery RedactConversationMessage where
toQuery :: RedactConversationMessage -> QueryString
toQuery =
QueryString -> RedactConversationMessage -> QueryString
forall a b. a -> b -> a
Prelude.const
([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=redact"])
data RedactConversationMessageResponse = RedactConversationMessageResponse'
{
RedactConversationMessageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool
(RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool)
-> (RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool)
-> Eq RedactConversationMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool
$c/= :: RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool
== :: RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool
$c== :: RedactConversationMessageResponse
-> RedactConversationMessageResponse -> Bool
Prelude.Eq, ReadPrec [RedactConversationMessageResponse]
ReadPrec RedactConversationMessageResponse
Int -> ReadS RedactConversationMessageResponse
ReadS [RedactConversationMessageResponse]
(Int -> ReadS RedactConversationMessageResponse)
-> ReadS [RedactConversationMessageResponse]
-> ReadPrec RedactConversationMessageResponse
-> ReadPrec [RedactConversationMessageResponse]
-> Read RedactConversationMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedactConversationMessageResponse]
$creadListPrec :: ReadPrec [RedactConversationMessageResponse]
readPrec :: ReadPrec RedactConversationMessageResponse
$creadPrec :: ReadPrec RedactConversationMessageResponse
readList :: ReadS [RedactConversationMessageResponse]
$creadList :: ReadS [RedactConversationMessageResponse]
readsPrec :: Int -> ReadS RedactConversationMessageResponse
$creadsPrec :: Int -> ReadS RedactConversationMessageResponse
Prelude.Read, Int -> RedactConversationMessageResponse -> ShowS
[RedactConversationMessageResponse] -> ShowS
RedactConversationMessageResponse -> String
(Int -> RedactConversationMessageResponse -> ShowS)
-> (RedactConversationMessageResponse -> String)
-> ([RedactConversationMessageResponse] -> ShowS)
-> Show RedactConversationMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedactConversationMessageResponse] -> ShowS
$cshowList :: [RedactConversationMessageResponse] -> ShowS
show :: RedactConversationMessageResponse -> String
$cshow :: RedactConversationMessageResponse -> String
showsPrec :: Int -> RedactConversationMessageResponse -> ShowS
$cshowsPrec :: Int -> RedactConversationMessageResponse -> ShowS
Prelude.Show, (forall x.
RedactConversationMessageResponse
-> Rep RedactConversationMessageResponse x)
-> (forall x.
Rep RedactConversationMessageResponse x
-> RedactConversationMessageResponse)
-> Generic RedactConversationMessageResponse
forall x.
Rep RedactConversationMessageResponse x
-> RedactConversationMessageResponse
forall x.
RedactConversationMessageResponse
-> Rep RedactConversationMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RedactConversationMessageResponse x
-> RedactConversationMessageResponse
$cfrom :: forall x.
RedactConversationMessageResponse
-> Rep RedactConversationMessageResponse x
Prelude.Generic)
newRedactConversationMessageResponse ::
Prelude.Int ->
RedactConversationMessageResponse
newRedactConversationMessageResponse :: Int -> RedactConversationMessageResponse
newRedactConversationMessageResponse Int
pHttpStatus_ =
RedactConversationMessageResponse' :: Int -> RedactConversationMessageResponse
RedactConversationMessageResponse'
{ $sel:httpStatus:RedactConversationMessageResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
redactConversationMessageResponse_httpStatus :: Lens.Lens' RedactConversationMessageResponse Prelude.Int
redactConversationMessageResponse_httpStatus :: (Int -> f Int)
-> RedactConversationMessageResponse
-> f RedactConversationMessageResponse
redactConversationMessageResponse_httpStatus = (RedactConversationMessageResponse -> Int)
-> (RedactConversationMessageResponse
-> Int -> RedactConversationMessageResponse)
-> Lens
RedactConversationMessageResponse
RedactConversationMessageResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedactConversationMessageResponse' {Int
httpStatus :: Int
$sel:httpStatus:RedactConversationMessageResponse' :: RedactConversationMessageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RedactConversationMessageResponse
s@RedactConversationMessageResponse' {} Int
a -> RedactConversationMessageResponse
s {$sel:httpStatus:RedactConversationMessageResponse' :: Int
httpStatus = Int
a} :: RedactConversationMessageResponse)
instance
Prelude.NFData
RedactConversationMessageResponse