{-# 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.ChimeSDKMessaging.UpdateChannelMessage
-- 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)
--
-- Updates the content of a message.
--
-- The @x-amz-chime-bearer@ request header is mandatory. Use the
-- @AppInstanceUserArn@ of the user that makes the API call as the value in
-- the header.
module Amazonka.ChimeSDKMessaging.UpdateChannelMessage
  ( -- * Creating a Request
    UpdateChannelMessage (..),
    newUpdateChannelMessage,

    -- * Request Lenses
    updateChannelMessage_content,
    updateChannelMessage_metadata,
    updateChannelMessage_channelArn,
    updateChannelMessage_messageId,
    updateChannelMessage_chimeBearer,

    -- * Destructuring the Response
    UpdateChannelMessageResponse (..),
    newUpdateChannelMessageResponse,

    -- * Response Lenses
    updateChannelMessageResponse_status,
    updateChannelMessageResponse_channelArn,
    updateChannelMessageResponse_messageId,
    updateChannelMessageResponse_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

-- | /See:/ 'newUpdateChannelMessage' smart constructor.
data UpdateChannelMessage = UpdateChannelMessage'
  { -- | The content of the message being updated.
    UpdateChannelMessage -> Maybe (Sensitive Text)
content :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The metadata of the message being updated.
    UpdateChannelMessage -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The ARN of the channel.
    UpdateChannelMessage -> Text
channelArn :: Prelude.Text,
    -- | The ID string of the message being updated.
    UpdateChannelMessage -> Text
messageId :: Prelude.Text,
    -- | The @AppInstanceUserArn@ of the user that makes the API call.
    UpdateChannelMessage -> Text
chimeBearer :: Prelude.Text
  }
  deriving (UpdateChannelMessage -> UpdateChannelMessage -> Bool
(UpdateChannelMessage -> UpdateChannelMessage -> Bool)
-> (UpdateChannelMessage -> UpdateChannelMessage -> Bool)
-> Eq UpdateChannelMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannelMessage -> UpdateChannelMessage -> Bool
$c/= :: UpdateChannelMessage -> UpdateChannelMessage -> Bool
== :: UpdateChannelMessage -> UpdateChannelMessage -> Bool
$c== :: UpdateChannelMessage -> UpdateChannelMessage -> Bool
Prelude.Eq, Int -> UpdateChannelMessage -> ShowS
[UpdateChannelMessage] -> ShowS
UpdateChannelMessage -> String
(Int -> UpdateChannelMessage -> ShowS)
-> (UpdateChannelMessage -> String)
-> ([UpdateChannelMessage] -> ShowS)
-> Show UpdateChannelMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannelMessage] -> ShowS
$cshowList :: [UpdateChannelMessage] -> ShowS
show :: UpdateChannelMessage -> String
$cshow :: UpdateChannelMessage -> String
showsPrec :: Int -> UpdateChannelMessage -> ShowS
$cshowsPrec :: Int -> UpdateChannelMessage -> ShowS
Prelude.Show, (forall x. UpdateChannelMessage -> Rep UpdateChannelMessage x)
-> (forall x. Rep UpdateChannelMessage x -> UpdateChannelMessage)
-> Generic UpdateChannelMessage
forall x. Rep UpdateChannelMessage x -> UpdateChannelMessage
forall x. UpdateChannelMessage -> Rep UpdateChannelMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChannelMessage x -> UpdateChannelMessage
$cfrom :: forall x. UpdateChannelMessage -> Rep UpdateChannelMessage x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChannelMessage' 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:
--
-- 'content', 'updateChannelMessage_content' - The content of the message being updated.
--
-- 'metadata', 'updateChannelMessage_metadata' - The metadata of the message being updated.
--
-- 'channelArn', 'updateChannelMessage_channelArn' - The ARN of the channel.
--
-- 'messageId', 'updateChannelMessage_messageId' - The ID string of the message being updated.
--
-- 'chimeBearer', 'updateChannelMessage_chimeBearer' - The @AppInstanceUserArn@ of the user that makes the API call.
newUpdateChannelMessage ::
  -- | 'channelArn'
  Prelude.Text ->
  -- | 'messageId'
  Prelude.Text ->
  -- | 'chimeBearer'
  Prelude.Text ->
  UpdateChannelMessage
newUpdateChannelMessage :: Text -> Text -> Text -> UpdateChannelMessage
newUpdateChannelMessage
  Text
pChannelArn_
  Text
pMessageId_
  Text
pChimeBearer_ =
    UpdateChannelMessage' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> Text
-> Text
-> UpdateChannelMessage
UpdateChannelMessage'
      { $sel:content:UpdateChannelMessage' :: Maybe (Sensitive Text)
content = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:metadata:UpdateChannelMessage' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:channelArn:UpdateChannelMessage' :: Text
channelArn = Text
pChannelArn_,
        $sel:messageId:UpdateChannelMessage' :: Text
messageId = Text
pMessageId_,
        $sel:chimeBearer:UpdateChannelMessage' :: Text
chimeBearer = Text
pChimeBearer_
      }

-- | The content of the message being updated.
updateChannelMessage_content :: Lens.Lens' UpdateChannelMessage (Prelude.Maybe Prelude.Text)
updateChannelMessage_content :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelMessage -> f UpdateChannelMessage
updateChannelMessage_content = (UpdateChannelMessage -> Maybe (Sensitive Text))
-> (UpdateChannelMessage
    -> Maybe (Sensitive Text) -> UpdateChannelMessage)
-> Lens
     UpdateChannelMessage
     UpdateChannelMessage
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessage' {Maybe (Sensitive Text)
content :: Maybe (Sensitive Text)
$sel:content:UpdateChannelMessage' :: UpdateChannelMessage -> Maybe (Sensitive Text)
content} -> Maybe (Sensitive Text)
content) (\s :: UpdateChannelMessage
s@UpdateChannelMessage' {} Maybe (Sensitive Text)
a -> UpdateChannelMessage
s {$sel:content:UpdateChannelMessage' :: Maybe (Sensitive Text)
content = Maybe (Sensitive Text)
a} :: UpdateChannelMessage) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateChannelMessage -> f UpdateChannelMessage)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateChannelMessage
-> f UpdateChannelMessage
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

-- | The metadata of the message being updated.
updateChannelMessage_metadata :: Lens.Lens' UpdateChannelMessage (Prelude.Maybe Prelude.Text)
updateChannelMessage_metadata :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelMessage -> f UpdateChannelMessage
updateChannelMessage_metadata = (UpdateChannelMessage -> Maybe (Sensitive Text))
-> (UpdateChannelMessage
    -> Maybe (Sensitive Text) -> UpdateChannelMessage)
-> Lens
     UpdateChannelMessage
     UpdateChannelMessage
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessage' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:UpdateChannelMessage' :: UpdateChannelMessage -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: UpdateChannelMessage
s@UpdateChannelMessage' {} Maybe (Sensitive Text)
a -> UpdateChannelMessage
s {$sel:metadata:UpdateChannelMessage' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: UpdateChannelMessage) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateChannelMessage -> f UpdateChannelMessage)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateChannelMessage
-> f UpdateChannelMessage
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

-- | The ARN of the channel.
updateChannelMessage_channelArn :: Lens.Lens' UpdateChannelMessage Prelude.Text
updateChannelMessage_channelArn :: (Text -> f Text) -> UpdateChannelMessage -> f UpdateChannelMessage
updateChannelMessage_channelArn = (UpdateChannelMessage -> Text)
-> (UpdateChannelMessage -> Text -> UpdateChannelMessage)
-> Lens UpdateChannelMessage UpdateChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessage' {Text
channelArn :: Text
$sel:channelArn:UpdateChannelMessage' :: UpdateChannelMessage -> Text
channelArn} -> Text
channelArn) (\s :: UpdateChannelMessage
s@UpdateChannelMessage' {} Text
a -> UpdateChannelMessage
s {$sel:channelArn:UpdateChannelMessage' :: Text
channelArn = Text
a} :: UpdateChannelMessage)

-- | The ID string of the message being updated.
updateChannelMessage_messageId :: Lens.Lens' UpdateChannelMessage Prelude.Text
updateChannelMessage_messageId :: (Text -> f Text) -> UpdateChannelMessage -> f UpdateChannelMessage
updateChannelMessage_messageId = (UpdateChannelMessage -> Text)
-> (UpdateChannelMessage -> Text -> UpdateChannelMessage)
-> Lens UpdateChannelMessage UpdateChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessage' {Text
messageId :: Text
$sel:messageId:UpdateChannelMessage' :: UpdateChannelMessage -> Text
messageId} -> Text
messageId) (\s :: UpdateChannelMessage
s@UpdateChannelMessage' {} Text
a -> UpdateChannelMessage
s {$sel:messageId:UpdateChannelMessage' :: Text
messageId = Text
a} :: UpdateChannelMessage)

-- | The @AppInstanceUserArn@ of the user that makes the API call.
updateChannelMessage_chimeBearer :: Lens.Lens' UpdateChannelMessage Prelude.Text
updateChannelMessage_chimeBearer :: (Text -> f Text) -> UpdateChannelMessage -> f UpdateChannelMessage
updateChannelMessage_chimeBearer = (UpdateChannelMessage -> Text)
-> (UpdateChannelMessage -> Text -> UpdateChannelMessage)
-> Lens UpdateChannelMessage UpdateChannelMessage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessage' {Text
chimeBearer :: Text
$sel:chimeBearer:UpdateChannelMessage' :: UpdateChannelMessage -> Text
chimeBearer} -> Text
chimeBearer) (\s :: UpdateChannelMessage
s@UpdateChannelMessage' {} Text
a -> UpdateChannelMessage
s {$sel:chimeBearer:UpdateChannelMessage' :: Text
chimeBearer = Text
a} :: UpdateChannelMessage)

instance Core.AWSRequest UpdateChannelMessage where
  type
    AWSResponse UpdateChannelMessage =
      UpdateChannelMessageResponse
  request :: UpdateChannelMessage -> Request UpdateChannelMessage
request = Service -> UpdateChannelMessage -> Request UpdateChannelMessage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateChannelMessage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateChannelMessage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateChannelMessage))
-> Logger
-> Service
-> Proxy UpdateChannelMessage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateChannelMessage)))
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 -> UpdateChannelMessageResponse
UpdateChannelMessageResponse'
            (Maybe ChannelMessageStatusStructure
 -> Maybe Text -> Maybe Text -> Int -> UpdateChannelMessageResponse)
-> Either String (Maybe ChannelMessageStatusStructure)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> UpdateChannelMessageResponse)
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 -> UpdateChannelMessageResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> UpdateChannelMessageResponse)
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 -> UpdateChannelMessageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateChannelMessageResponse)
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 -> UpdateChannelMessageResponse)
-> Either String Int -> Either String UpdateChannelMessageResponse
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 UpdateChannelMessage

instance Prelude.NFData UpdateChannelMessage

instance Core.ToHeaders UpdateChannelMessage where
  toHeaders :: UpdateChannelMessage -> ResponseHeaders
toHeaders UpdateChannelMessage' {Maybe (Sensitive Text)
Text
chimeBearer :: Text
messageId :: Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
content :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:messageId:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:channelArn:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:metadata:UpdateChannelMessage' :: UpdateChannelMessage -> Maybe (Sensitive Text)
$sel:content:UpdateChannelMessage' :: UpdateChannelMessage -> 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 UpdateChannelMessage where
  toJSON :: UpdateChannelMessage -> Value
toJSON UpdateChannelMessage' {Maybe (Sensitive Text)
Text
chimeBearer :: Text
messageId :: Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
content :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:messageId:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:channelArn:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:metadata:UpdateChannelMessage' :: UpdateChannelMessage -> Maybe (Sensitive Text)
$sel:content:UpdateChannelMessage' :: UpdateChannelMessage -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Content" 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)
content,
            (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
          ]
      )

instance Core.ToPath UpdateChannelMessage where
  toPath :: UpdateChannelMessage -> ByteString
toPath UpdateChannelMessage' {Maybe (Sensitive Text)
Text
chimeBearer :: Text
messageId :: Text
channelArn :: Text
metadata :: Maybe (Sensitive Text)
content :: Maybe (Sensitive Text)
$sel:chimeBearer:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:messageId:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:channelArn:UpdateChannelMessage' :: UpdateChannelMessage -> Text
$sel:metadata:UpdateChannelMessage' :: UpdateChannelMessage -> Maybe (Sensitive Text)
$sel:content:UpdateChannelMessage' :: UpdateChannelMessage -> 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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
messageId
      ]

instance Core.ToQuery UpdateChannelMessage where
  toQuery :: UpdateChannelMessage -> QueryString
toQuery = QueryString -> UpdateChannelMessage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateChannelMessageResponse' smart constructor.
data UpdateChannelMessageResponse = UpdateChannelMessageResponse'
  { -- | The status of the message update.
    UpdateChannelMessageResponse -> Maybe ChannelMessageStatusStructure
status :: Prelude.Maybe ChannelMessageStatusStructure,
    -- | The ARN of the channel.
    UpdateChannelMessageResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
    -- | The ID string of the message being updated.
    UpdateChannelMessageResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateChannelMessageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateChannelMessageResponse
-> UpdateChannelMessageResponse -> Bool
(UpdateChannelMessageResponse
 -> UpdateChannelMessageResponse -> Bool)
-> (UpdateChannelMessageResponse
    -> UpdateChannelMessageResponse -> Bool)
-> Eq UpdateChannelMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannelMessageResponse
-> UpdateChannelMessageResponse -> Bool
$c/= :: UpdateChannelMessageResponse
-> UpdateChannelMessageResponse -> Bool
== :: UpdateChannelMessageResponse
-> UpdateChannelMessageResponse -> Bool
$c== :: UpdateChannelMessageResponse
-> UpdateChannelMessageResponse -> Bool
Prelude.Eq, ReadPrec [UpdateChannelMessageResponse]
ReadPrec UpdateChannelMessageResponse
Int -> ReadS UpdateChannelMessageResponse
ReadS [UpdateChannelMessageResponse]
(Int -> ReadS UpdateChannelMessageResponse)
-> ReadS [UpdateChannelMessageResponse]
-> ReadPrec UpdateChannelMessageResponse
-> ReadPrec [UpdateChannelMessageResponse]
-> Read UpdateChannelMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChannelMessageResponse]
$creadListPrec :: ReadPrec [UpdateChannelMessageResponse]
readPrec :: ReadPrec UpdateChannelMessageResponse
$creadPrec :: ReadPrec UpdateChannelMessageResponse
readList :: ReadS [UpdateChannelMessageResponse]
$creadList :: ReadS [UpdateChannelMessageResponse]
readsPrec :: Int -> ReadS UpdateChannelMessageResponse
$creadsPrec :: Int -> ReadS UpdateChannelMessageResponse
Prelude.Read, Int -> UpdateChannelMessageResponse -> ShowS
[UpdateChannelMessageResponse] -> ShowS
UpdateChannelMessageResponse -> String
(Int -> UpdateChannelMessageResponse -> ShowS)
-> (UpdateChannelMessageResponse -> String)
-> ([UpdateChannelMessageResponse] -> ShowS)
-> Show UpdateChannelMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannelMessageResponse] -> ShowS
$cshowList :: [UpdateChannelMessageResponse] -> ShowS
show :: UpdateChannelMessageResponse -> String
$cshow :: UpdateChannelMessageResponse -> String
showsPrec :: Int -> UpdateChannelMessageResponse -> ShowS
$cshowsPrec :: Int -> UpdateChannelMessageResponse -> ShowS
Prelude.Show, (forall x.
 UpdateChannelMessageResponse -> Rep UpdateChannelMessageResponse x)
-> (forall x.
    Rep UpdateChannelMessageResponse x -> UpdateChannelMessageResponse)
-> Generic UpdateChannelMessageResponse
forall x.
Rep UpdateChannelMessageResponse x -> UpdateChannelMessageResponse
forall x.
UpdateChannelMessageResponse -> Rep UpdateChannelMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateChannelMessageResponse x -> UpdateChannelMessageResponse
$cfrom :: forall x.
UpdateChannelMessageResponse -> Rep UpdateChannelMessageResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChannelMessageResponse' 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:
--
-- 'status', 'updateChannelMessageResponse_status' - The status of the message update.
--
-- 'channelArn', 'updateChannelMessageResponse_channelArn' - The ARN of the channel.
--
-- 'messageId', 'updateChannelMessageResponse_messageId' - The ID string of the message being updated.
--
-- 'httpStatus', 'updateChannelMessageResponse_httpStatus' - The response's http status code.
newUpdateChannelMessageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateChannelMessageResponse
newUpdateChannelMessageResponse :: Int -> UpdateChannelMessageResponse
newUpdateChannelMessageResponse Int
pHttpStatus_ =
  UpdateChannelMessageResponse' :: Maybe ChannelMessageStatusStructure
-> Maybe Text -> Maybe Text -> Int -> UpdateChannelMessageResponse
UpdateChannelMessageResponse'
    { $sel:status:UpdateChannelMessageResponse' :: Maybe ChannelMessageStatusStructure
status =
        Maybe ChannelMessageStatusStructure
forall a. Maybe a
Prelude.Nothing,
      $sel:channelArn:UpdateChannelMessageResponse' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageId:UpdateChannelMessageResponse' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateChannelMessageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the message update.
updateChannelMessageResponse_status :: Lens.Lens' UpdateChannelMessageResponse (Prelude.Maybe ChannelMessageStatusStructure)
updateChannelMessageResponse_status :: (Maybe ChannelMessageStatusStructure
 -> f (Maybe ChannelMessageStatusStructure))
-> UpdateChannelMessageResponse -> f UpdateChannelMessageResponse
updateChannelMessageResponse_status = (UpdateChannelMessageResponse
 -> Maybe ChannelMessageStatusStructure)
-> (UpdateChannelMessageResponse
    -> Maybe ChannelMessageStatusStructure
    -> UpdateChannelMessageResponse)
-> Lens
     UpdateChannelMessageResponse
     UpdateChannelMessageResponse
     (Maybe ChannelMessageStatusStructure)
     (Maybe ChannelMessageStatusStructure)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessageResponse' {Maybe ChannelMessageStatusStructure
status :: Maybe ChannelMessageStatusStructure
$sel:status:UpdateChannelMessageResponse' :: UpdateChannelMessageResponse -> Maybe ChannelMessageStatusStructure
status} -> Maybe ChannelMessageStatusStructure
status) (\s :: UpdateChannelMessageResponse
s@UpdateChannelMessageResponse' {} Maybe ChannelMessageStatusStructure
a -> UpdateChannelMessageResponse
s {$sel:status:UpdateChannelMessageResponse' :: Maybe ChannelMessageStatusStructure
status = Maybe ChannelMessageStatusStructure
a} :: UpdateChannelMessageResponse)

-- | The ARN of the channel.
updateChannelMessageResponse_channelArn :: Lens.Lens' UpdateChannelMessageResponse (Prelude.Maybe Prelude.Text)
updateChannelMessageResponse_channelArn :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelMessageResponse -> f UpdateChannelMessageResponse
updateChannelMessageResponse_channelArn = (UpdateChannelMessageResponse -> Maybe Text)
-> (UpdateChannelMessageResponse
    -> Maybe Text -> UpdateChannelMessageResponse)
-> Lens
     UpdateChannelMessageResponse
     UpdateChannelMessageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessageResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:UpdateChannelMessageResponse' :: UpdateChannelMessageResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: UpdateChannelMessageResponse
s@UpdateChannelMessageResponse' {} Maybe Text
a -> UpdateChannelMessageResponse
s {$sel:channelArn:UpdateChannelMessageResponse' :: Maybe Text
channelArn = Maybe Text
a} :: UpdateChannelMessageResponse)

-- | The ID string of the message being updated.
updateChannelMessageResponse_messageId :: Lens.Lens' UpdateChannelMessageResponse (Prelude.Maybe Prelude.Text)
updateChannelMessageResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelMessageResponse -> f UpdateChannelMessageResponse
updateChannelMessageResponse_messageId = (UpdateChannelMessageResponse -> Maybe Text)
-> (UpdateChannelMessageResponse
    -> Maybe Text -> UpdateChannelMessageResponse)
-> Lens
     UpdateChannelMessageResponse
     UpdateChannelMessageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessageResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:UpdateChannelMessageResponse' :: UpdateChannelMessageResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: UpdateChannelMessageResponse
s@UpdateChannelMessageResponse' {} Maybe Text
a -> UpdateChannelMessageResponse
s {$sel:messageId:UpdateChannelMessageResponse' :: Maybe Text
messageId = Maybe Text
a} :: UpdateChannelMessageResponse)

-- | The response's http status code.
updateChannelMessageResponse_httpStatus :: Lens.Lens' UpdateChannelMessageResponse Prelude.Int
updateChannelMessageResponse_httpStatus :: (Int -> f Int)
-> UpdateChannelMessageResponse -> f UpdateChannelMessageResponse
updateChannelMessageResponse_httpStatus = (UpdateChannelMessageResponse -> Int)
-> (UpdateChannelMessageResponse
    -> Int -> UpdateChannelMessageResponse)
-> Lens
     UpdateChannelMessageResponse UpdateChannelMessageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelMessageResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateChannelMessageResponse' :: UpdateChannelMessageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateChannelMessageResponse
s@UpdateChannelMessageResponse' {} Int
a -> UpdateChannelMessageResponse
s {$sel:httpStatus:UpdateChannelMessageResponse' :: Int
httpStatus = Int
a} :: UpdateChannelMessageResponse)

instance Prelude.NFData UpdateChannelMessageResponse