{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ChannelMessageStatusStructure
-- 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)
module Amazonka.ChimeSDKMessaging.Types.ChannelMessageStatusStructure where

import Amazonka.ChimeSDKMessaging.Types.ChannelMessageStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Stores information about a message status.
--
-- /See:/ 'newChannelMessageStatusStructure' smart constructor.
data ChannelMessageStatusStructure = ChannelMessageStatusStructure'
  { -- | The message status value.
    ChannelMessageStatusStructure -> Maybe ChannelMessageStatus
value :: Prelude.Maybe ChannelMessageStatus,
    -- | Contains more details about the messasge status.
    ChannelMessageStatusStructure -> Maybe Text
detail :: Prelude.Maybe Prelude.Text
  }
  deriving (ChannelMessageStatusStructure
-> ChannelMessageStatusStructure -> Bool
(ChannelMessageStatusStructure
 -> ChannelMessageStatusStructure -> Bool)
-> (ChannelMessageStatusStructure
    -> ChannelMessageStatusStructure -> Bool)
-> Eq ChannelMessageStatusStructure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelMessageStatusStructure
-> ChannelMessageStatusStructure -> Bool
$c/= :: ChannelMessageStatusStructure
-> ChannelMessageStatusStructure -> Bool
== :: ChannelMessageStatusStructure
-> ChannelMessageStatusStructure -> Bool
$c== :: ChannelMessageStatusStructure
-> ChannelMessageStatusStructure -> Bool
Prelude.Eq, ReadPrec [ChannelMessageStatusStructure]
ReadPrec ChannelMessageStatusStructure
Int -> ReadS ChannelMessageStatusStructure
ReadS [ChannelMessageStatusStructure]
(Int -> ReadS ChannelMessageStatusStructure)
-> ReadS [ChannelMessageStatusStructure]
-> ReadPrec ChannelMessageStatusStructure
-> ReadPrec [ChannelMessageStatusStructure]
-> Read ChannelMessageStatusStructure
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelMessageStatusStructure]
$creadListPrec :: ReadPrec [ChannelMessageStatusStructure]
readPrec :: ReadPrec ChannelMessageStatusStructure
$creadPrec :: ReadPrec ChannelMessageStatusStructure
readList :: ReadS [ChannelMessageStatusStructure]
$creadList :: ReadS [ChannelMessageStatusStructure]
readsPrec :: Int -> ReadS ChannelMessageStatusStructure
$creadsPrec :: Int -> ReadS ChannelMessageStatusStructure
Prelude.Read, Int -> ChannelMessageStatusStructure -> ShowS
[ChannelMessageStatusStructure] -> ShowS
ChannelMessageStatusStructure -> String
(Int -> ChannelMessageStatusStructure -> ShowS)
-> (ChannelMessageStatusStructure -> String)
-> ([ChannelMessageStatusStructure] -> ShowS)
-> Show ChannelMessageStatusStructure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelMessageStatusStructure] -> ShowS
$cshowList :: [ChannelMessageStatusStructure] -> ShowS
show :: ChannelMessageStatusStructure -> String
$cshow :: ChannelMessageStatusStructure -> String
showsPrec :: Int -> ChannelMessageStatusStructure -> ShowS
$cshowsPrec :: Int -> ChannelMessageStatusStructure -> ShowS
Prelude.Show, (forall x.
 ChannelMessageStatusStructure
 -> Rep ChannelMessageStatusStructure x)
-> (forall x.
    Rep ChannelMessageStatusStructure x
    -> ChannelMessageStatusStructure)
-> Generic ChannelMessageStatusStructure
forall x.
Rep ChannelMessageStatusStructure x
-> ChannelMessageStatusStructure
forall x.
ChannelMessageStatusStructure
-> Rep ChannelMessageStatusStructure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChannelMessageStatusStructure x
-> ChannelMessageStatusStructure
$cfrom :: forall x.
ChannelMessageStatusStructure
-> Rep ChannelMessageStatusStructure x
Prelude.Generic)

-- |
-- Create a value of 'ChannelMessageStatusStructure' 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:
--
-- 'value', 'channelMessageStatusStructure_value' - The message status value.
--
-- 'detail', 'channelMessageStatusStructure_detail' - Contains more details about the messasge status.
newChannelMessageStatusStructure ::
  ChannelMessageStatusStructure
newChannelMessageStatusStructure :: ChannelMessageStatusStructure
newChannelMessageStatusStructure =
  ChannelMessageStatusStructure' :: Maybe ChannelMessageStatus
-> Maybe Text -> ChannelMessageStatusStructure
ChannelMessageStatusStructure'
    { $sel:value:ChannelMessageStatusStructure' :: Maybe ChannelMessageStatus
value =
        Maybe ChannelMessageStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:detail:ChannelMessageStatusStructure' :: Maybe Text
detail = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The message status value.
channelMessageStatusStructure_value :: Lens.Lens' ChannelMessageStatusStructure (Prelude.Maybe ChannelMessageStatus)
channelMessageStatusStructure_value :: (Maybe ChannelMessageStatus -> f (Maybe ChannelMessageStatus))
-> ChannelMessageStatusStructure -> f ChannelMessageStatusStructure
channelMessageStatusStructure_value = (ChannelMessageStatusStructure -> Maybe ChannelMessageStatus)
-> (ChannelMessageStatusStructure
    -> Maybe ChannelMessageStatus -> ChannelMessageStatusStructure)
-> Lens
     ChannelMessageStatusStructure
     ChannelMessageStatusStructure
     (Maybe ChannelMessageStatus)
     (Maybe ChannelMessageStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelMessageStatusStructure' {Maybe ChannelMessageStatus
value :: Maybe ChannelMessageStatus
$sel:value:ChannelMessageStatusStructure' :: ChannelMessageStatusStructure -> Maybe ChannelMessageStatus
value} -> Maybe ChannelMessageStatus
value) (\s :: ChannelMessageStatusStructure
s@ChannelMessageStatusStructure' {} Maybe ChannelMessageStatus
a -> ChannelMessageStatusStructure
s {$sel:value:ChannelMessageStatusStructure' :: Maybe ChannelMessageStatus
value = Maybe ChannelMessageStatus
a} :: ChannelMessageStatusStructure)

-- | Contains more details about the messasge status.
channelMessageStatusStructure_detail :: Lens.Lens' ChannelMessageStatusStructure (Prelude.Maybe Prelude.Text)
channelMessageStatusStructure_detail :: (Maybe Text -> f (Maybe Text))
-> ChannelMessageStatusStructure -> f ChannelMessageStatusStructure
channelMessageStatusStructure_detail = (ChannelMessageStatusStructure -> Maybe Text)
-> (ChannelMessageStatusStructure
    -> Maybe Text -> ChannelMessageStatusStructure)
-> Lens
     ChannelMessageStatusStructure
     ChannelMessageStatusStructure
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelMessageStatusStructure' {Maybe Text
detail :: Maybe Text
$sel:detail:ChannelMessageStatusStructure' :: ChannelMessageStatusStructure -> Maybe Text
detail} -> Maybe Text
detail) (\s :: ChannelMessageStatusStructure
s@ChannelMessageStatusStructure' {} Maybe Text
a -> ChannelMessageStatusStructure
s {$sel:detail:ChannelMessageStatusStructure' :: Maybe Text
detail = Maybe Text
a} :: ChannelMessageStatusStructure)

instance Core.FromJSON ChannelMessageStatusStructure where
  parseJSON :: Value -> Parser ChannelMessageStatusStructure
parseJSON =
    String
-> (Object -> Parser ChannelMessageStatusStructure)
-> Value
-> Parser ChannelMessageStatusStructure
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChannelMessageStatusStructure"
      ( \Object
x ->
          Maybe ChannelMessageStatus
-> Maybe Text -> ChannelMessageStatusStructure
ChannelMessageStatusStructure'
            (Maybe ChannelMessageStatus
 -> Maybe Text -> ChannelMessageStatusStructure)
-> Parser (Maybe ChannelMessageStatus)
-> Parser (Maybe Text -> ChannelMessageStatusStructure)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ChannelMessageStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value")
            Parser (Maybe Text -> ChannelMessageStatusStructure)
-> Parser (Maybe Text) -> Parser ChannelMessageStatusStructure
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Detail")
      )

instance
  Prelude.Hashable
    ChannelMessageStatusStructure

instance Prelude.NFData ChannelMessageStatusStructure