{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Chime.RedactConversationMessage
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Redacts the specified message from the specified Amazon Chime
-- conversation.
module Amazonka.Chime.RedactConversationMessage
  ( -- * Creating a Request
    RedactConversationMessage (..),
    newRedactConversationMessage,

    -- * Request Lenses
    redactConversationMessage_accountId,
    redactConversationMessage_conversationId,
    redactConversationMessage_messageId,

    -- * Destructuring the Response
    RedactConversationMessageResponse (..),
    newRedactConversationMessageResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newRedactConversationMessage' smart constructor.
data RedactConversationMessage = RedactConversationMessage'
  { -- | The Amazon Chime account ID.
    RedactConversationMessage -> Text
accountId :: Prelude.Text,
    -- | The conversation ID.
    RedactConversationMessage -> Text
conversationId :: Prelude.Text,
    -- | The message ID.
    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)

-- |
-- Create a value of 'RedactConversationMessage' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'accountId', 'redactConversationMessage_accountId' - The Amazon Chime account ID.
--
-- 'conversationId', 'redactConversationMessage_conversationId' - The conversation ID.
--
-- 'messageId', 'redactConversationMessage_messageId' - The message ID.
newRedactConversationMessage ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'conversationId'
  Prelude.Text ->
  -- | 'messageId'
  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_
      }

-- | The Amazon Chime account ID.
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)

-- | The conversation ID.
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)

-- | The message ID.
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"])

-- | /See:/ 'newRedactConversationMessageResponse' smart constructor.
data RedactConversationMessageResponse = RedactConversationMessageResponse'
  { -- | The response's http status code.
    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)

-- |
-- Create a value of 'RedactConversationMessageResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'redactConversationMessageResponse_httpStatus' - The response's http status code.
newRedactConversationMessageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RedactConversationMessageResponse
newRedactConversationMessageResponse :: Int -> RedactConversationMessageResponse
newRedactConversationMessageResponse Int
pHttpStatus_ =
  RedactConversationMessageResponse' :: Int -> RedactConversationMessageResponse
RedactConversationMessageResponse'
    { $sel:httpStatus:RedactConversationMessageResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
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