{-# 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.IVSChat.Types.RoomSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IVSChat.Types.RoomSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IVSChat.Types.MessageReviewHandler
import qualified Amazonka.Prelude as Prelude

-- | Summary information about a room.
--
-- /See:/ 'newRoomSummary' smart constructor.
data RoomSummary = RoomSummary'
  { -- | Room ARN.
    RoomSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Time when the room was created. This is an ISO 8601 timestamp; /note
    -- that this is returned as a string/.
    RoomSummary -> Maybe ISO8601
createTime :: Prelude.Maybe Data.ISO8601,
    -- | Room ID, generated by the system. This is a relative identifier, the
    -- part of the ARN that uniquely identifies the room.
    RoomSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | List of logging-configuration identifiers attached to the room.
    RoomSummary -> Maybe [Text]
loggingConfigurationIdentifiers :: Prelude.Maybe [Prelude.Text],
    -- | Configuration information for optional review of messages.
    RoomSummary -> Maybe MessageReviewHandler
messageReviewHandler :: Prelude.Maybe MessageReviewHandler,
    -- | Room name. The value does not need to be unique.
    RoomSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Tags attached to the resource. Array of maps, each of the form
    -- @string:string (key:value)@. See
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
    -- for details, including restrictions that apply to tags and \"Tag naming
    -- limits and requirements\"; Amazon IVS Chat has no constraints beyond
    -- what is documented there.
    RoomSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Time of the room’s last update. This is an ISO 8601 timestamp; /note
    -- that this is returned as a string/.
    RoomSummary -> Maybe ISO8601
updateTime :: Prelude.Maybe Data.ISO8601
  }
  deriving (RoomSummary -> RoomSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoomSummary -> RoomSummary -> Bool
$c/= :: RoomSummary -> RoomSummary -> Bool
== :: RoomSummary -> RoomSummary -> Bool
$c== :: RoomSummary -> RoomSummary -> Bool
Prelude.Eq, ReadPrec [RoomSummary]
ReadPrec RoomSummary
Int -> ReadS RoomSummary
ReadS [RoomSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoomSummary]
$creadListPrec :: ReadPrec [RoomSummary]
readPrec :: ReadPrec RoomSummary
$creadPrec :: ReadPrec RoomSummary
readList :: ReadS [RoomSummary]
$creadList :: ReadS [RoomSummary]
readsPrec :: Int -> ReadS RoomSummary
$creadsPrec :: Int -> ReadS RoomSummary
Prelude.Read, Int -> RoomSummary -> ShowS
[RoomSummary] -> ShowS
RoomSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoomSummary] -> ShowS
$cshowList :: [RoomSummary] -> ShowS
show :: RoomSummary -> String
$cshow :: RoomSummary -> String
showsPrec :: Int -> RoomSummary -> ShowS
$cshowsPrec :: Int -> RoomSummary -> ShowS
Prelude.Show, forall x. Rep RoomSummary x -> RoomSummary
forall x. RoomSummary -> Rep RoomSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoomSummary x -> RoomSummary
$cfrom :: forall x. RoomSummary -> Rep RoomSummary x
Prelude.Generic)

-- |
-- Create a value of 'RoomSummary' 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:
--
-- 'arn', 'roomSummary_arn' - Room ARN.
--
-- 'createTime', 'roomSummary_createTime' - Time when the room was created. This is an ISO 8601 timestamp; /note
-- that this is returned as a string/.
--
-- 'id', 'roomSummary_id' - Room ID, generated by the system. This is a relative identifier, the
-- part of the ARN that uniquely identifies the room.
--
-- 'loggingConfigurationIdentifiers', 'roomSummary_loggingConfigurationIdentifiers' - List of logging-configuration identifiers attached to the room.
--
-- 'messageReviewHandler', 'roomSummary_messageReviewHandler' - Configuration information for optional review of messages.
--
-- 'name', 'roomSummary_name' - Room name. The value does not need to be unique.
--
-- 'tags', 'roomSummary_tags' - Tags attached to the resource. Array of maps, each of the form
-- @string:string (key:value)@. See
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- for details, including restrictions that apply to tags and \"Tag naming
-- limits and requirements\"; Amazon IVS Chat has no constraints beyond
-- what is documented there.
--
-- 'updateTime', 'roomSummary_updateTime' - Time of the room’s last update. This is an ISO 8601 timestamp; /note
-- that this is returned as a string/.
newRoomSummary ::
  RoomSummary
newRoomSummary :: RoomSummary
newRoomSummary =
  RoomSummary'
    { $sel:arn:RoomSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createTime:RoomSummary' :: Maybe ISO8601
createTime = forall a. Maybe a
Prelude.Nothing,
      $sel:id:RoomSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:loggingConfigurationIdentifiers:RoomSummary' :: Maybe [Text]
loggingConfigurationIdentifiers = forall a. Maybe a
Prelude.Nothing,
      $sel:messageReviewHandler:RoomSummary' :: Maybe MessageReviewHandler
messageReviewHandler = forall a. Maybe a
Prelude.Nothing,
      $sel:name:RoomSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RoomSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:updateTime:RoomSummary' :: Maybe ISO8601
updateTime = forall a. Maybe a
Prelude.Nothing
    }

-- | Room ARN.
roomSummary_arn :: Lens.Lens' RoomSummary (Prelude.Maybe Prelude.Text)
roomSummary_arn :: Lens' RoomSummary (Maybe Text)
roomSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:RoomSummary' :: RoomSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RoomSummary
s@RoomSummary' {} Maybe Text
a -> RoomSummary
s {$sel:arn:RoomSummary' :: Maybe Text
arn = Maybe Text
a} :: RoomSummary)

-- | Time when the room was created. This is an ISO 8601 timestamp; /note
-- that this is returned as a string/.
roomSummary_createTime :: Lens.Lens' RoomSummary (Prelude.Maybe Prelude.UTCTime)
roomSummary_createTime :: Lens' RoomSummary (Maybe UTCTime)
roomSummary_createTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe ISO8601
createTime :: Maybe ISO8601
$sel:createTime:RoomSummary' :: RoomSummary -> Maybe ISO8601
createTime} -> Maybe ISO8601
createTime) (\s :: RoomSummary
s@RoomSummary' {} Maybe ISO8601
a -> RoomSummary
s {$sel:createTime:RoomSummary' :: Maybe ISO8601
createTime = Maybe ISO8601
a} :: RoomSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Room ID, generated by the system. This is a relative identifier, the
-- part of the ARN that uniquely identifies the room.
roomSummary_id :: Lens.Lens' RoomSummary (Prelude.Maybe Prelude.Text)
roomSummary_id :: Lens' RoomSummary (Maybe Text)
roomSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe Text
id :: Maybe Text
$sel:id:RoomSummary' :: RoomSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: RoomSummary
s@RoomSummary' {} Maybe Text
a -> RoomSummary
s {$sel:id:RoomSummary' :: Maybe Text
id = Maybe Text
a} :: RoomSummary)

-- | List of logging-configuration identifiers attached to the room.
roomSummary_loggingConfigurationIdentifiers :: Lens.Lens' RoomSummary (Prelude.Maybe [Prelude.Text])
roomSummary_loggingConfigurationIdentifiers :: Lens' RoomSummary (Maybe [Text])
roomSummary_loggingConfigurationIdentifiers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe [Text]
loggingConfigurationIdentifiers :: Maybe [Text]
$sel:loggingConfigurationIdentifiers:RoomSummary' :: RoomSummary -> Maybe [Text]
loggingConfigurationIdentifiers} -> Maybe [Text]
loggingConfigurationIdentifiers) (\s :: RoomSummary
s@RoomSummary' {} Maybe [Text]
a -> RoomSummary
s {$sel:loggingConfigurationIdentifiers:RoomSummary' :: Maybe [Text]
loggingConfigurationIdentifiers = Maybe [Text]
a} :: RoomSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Configuration information for optional review of messages.
roomSummary_messageReviewHandler :: Lens.Lens' RoomSummary (Prelude.Maybe MessageReviewHandler)
roomSummary_messageReviewHandler :: Lens' RoomSummary (Maybe MessageReviewHandler)
roomSummary_messageReviewHandler = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe MessageReviewHandler
messageReviewHandler :: Maybe MessageReviewHandler
$sel:messageReviewHandler:RoomSummary' :: RoomSummary -> Maybe MessageReviewHandler
messageReviewHandler} -> Maybe MessageReviewHandler
messageReviewHandler) (\s :: RoomSummary
s@RoomSummary' {} Maybe MessageReviewHandler
a -> RoomSummary
s {$sel:messageReviewHandler:RoomSummary' :: Maybe MessageReviewHandler
messageReviewHandler = Maybe MessageReviewHandler
a} :: RoomSummary)

-- | Room name. The value does not need to be unique.
roomSummary_name :: Lens.Lens' RoomSummary (Prelude.Maybe Prelude.Text)
roomSummary_name :: Lens' RoomSummary (Maybe Text)
roomSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe Text
name :: Maybe Text
$sel:name:RoomSummary' :: RoomSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: RoomSummary
s@RoomSummary' {} Maybe Text
a -> RoomSummary
s {$sel:name:RoomSummary' :: Maybe Text
name = Maybe Text
a} :: RoomSummary)

-- | Tags attached to the resource. Array of maps, each of the form
-- @string:string (key:value)@. See
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- for details, including restrictions that apply to tags and \"Tag naming
-- limits and requirements\"; Amazon IVS Chat has no constraints beyond
-- what is documented there.
roomSummary_tags :: Lens.Lens' RoomSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
roomSummary_tags :: Lens' RoomSummary (Maybe (HashMap Text Text))
roomSummary_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RoomSummary' :: RoomSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RoomSummary
s@RoomSummary' {} Maybe (HashMap Text Text)
a -> RoomSummary
s {$sel:tags:RoomSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RoomSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Time of the room’s last update. This is an ISO 8601 timestamp; /note
-- that this is returned as a string/.
roomSummary_updateTime :: Lens.Lens' RoomSummary (Prelude.Maybe Prelude.UTCTime)
roomSummary_updateTime :: Lens' RoomSummary (Maybe UTCTime)
roomSummary_updateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoomSummary' {Maybe ISO8601
updateTime :: Maybe ISO8601
$sel:updateTime:RoomSummary' :: RoomSummary -> Maybe ISO8601
updateTime} -> Maybe ISO8601
updateTime) (\s :: RoomSummary
s@RoomSummary' {} Maybe ISO8601
a -> RoomSummary
s {$sel:updateTime:RoomSummary' :: Maybe ISO8601
updateTime = Maybe ISO8601
a} :: RoomSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON RoomSummary where
  parseJSON :: Value -> Parser RoomSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RoomSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe [Text]
-> Maybe MessageReviewHandler
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe ISO8601
-> RoomSummary
RoomSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"loggingConfigurationIdentifiers"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"messageReviewHandler")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"updateTime")
      )

instance Prelude.Hashable RoomSummary where
  hashWithSalt :: Int -> RoomSummary -> Int
hashWithSalt Int
_salt RoomSummary' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe MessageReviewHandler
updateTime :: Maybe ISO8601
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
messageReviewHandler :: Maybe MessageReviewHandler
loggingConfigurationIdentifiers :: Maybe [Text]
id :: Maybe Text
createTime :: Maybe ISO8601
arn :: Maybe Text
$sel:updateTime:RoomSummary' :: RoomSummary -> Maybe ISO8601
$sel:tags:RoomSummary' :: RoomSummary -> Maybe (HashMap Text Text)
$sel:name:RoomSummary' :: RoomSummary -> Maybe Text
$sel:messageReviewHandler:RoomSummary' :: RoomSummary -> Maybe MessageReviewHandler
$sel:loggingConfigurationIdentifiers:RoomSummary' :: RoomSummary -> Maybe [Text]
$sel:id:RoomSummary' :: RoomSummary -> Maybe Text
$sel:createTime:RoomSummary' :: RoomSummary -> Maybe ISO8601
$sel:arn:RoomSummary' :: RoomSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
loggingConfigurationIdentifiers
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MessageReviewHandler
messageReviewHandler
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
updateTime

instance Prelude.NFData RoomSummary where
  rnf :: RoomSummary -> ()
rnf RoomSummary' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe MessageReviewHandler
updateTime :: Maybe ISO8601
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
messageReviewHandler :: Maybe MessageReviewHandler
loggingConfigurationIdentifiers :: Maybe [Text]
id :: Maybe Text
createTime :: Maybe ISO8601
arn :: Maybe Text
$sel:updateTime:RoomSummary' :: RoomSummary -> Maybe ISO8601
$sel:tags:RoomSummary' :: RoomSummary -> Maybe (HashMap Text Text)
$sel:name:RoomSummary' :: RoomSummary -> Maybe Text
$sel:messageReviewHandler:RoomSummary' :: RoomSummary -> Maybe MessageReviewHandler
$sel:loggingConfigurationIdentifiers:RoomSummary' :: RoomSummary -> Maybe [Text]
$sel:id:RoomSummary' :: RoomSummary -> Maybe Text
$sel:createTime:RoomSummary' :: RoomSummary -> Maybe ISO8601
$sel:arn:RoomSummary' :: RoomSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
loggingConfigurationIdentifiers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MessageReviewHandler
messageReviewHandler
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
updateTime