{-# 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.AlexaBusiness.Types.Room
-- 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.AlexaBusiness.Types.Room where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A room with attributes.
--
-- /See:/ 'newRoom' smart constructor.
data Room = Room'
  { -- | The profile ARN of a room.
    Room -> Maybe Text
profileArn :: Prelude.Maybe Prelude.Text,
    -- | The provider calendar ARN of a room.
    Room -> Maybe Text
providerCalendarId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of a room.
    Room -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text,
    -- | The name of a room.
    Room -> Maybe Text
roomName :: Prelude.Maybe Prelude.Text,
    -- | The description of a room.
    Room -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (Room -> Room -> Bool
(Room -> Room -> Bool) -> (Room -> Room -> Bool) -> Eq Room
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Room -> Room -> Bool
$c/= :: Room -> Room -> Bool
== :: Room -> Room -> Bool
$c== :: Room -> Room -> Bool
Prelude.Eq, ReadPrec [Room]
ReadPrec Room
Int -> ReadS Room
ReadS [Room]
(Int -> ReadS Room)
-> ReadS [Room] -> ReadPrec Room -> ReadPrec [Room] -> Read Room
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Room]
$creadListPrec :: ReadPrec [Room]
readPrec :: ReadPrec Room
$creadPrec :: ReadPrec Room
readList :: ReadS [Room]
$creadList :: ReadS [Room]
readsPrec :: Int -> ReadS Room
$creadsPrec :: Int -> ReadS Room
Prelude.Read, Int -> Room -> ShowS
[Room] -> ShowS
Room -> String
(Int -> Room -> ShowS)
-> (Room -> String) -> ([Room] -> ShowS) -> Show Room
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Room] -> ShowS
$cshowList :: [Room] -> ShowS
show :: Room -> String
$cshow :: Room -> String
showsPrec :: Int -> Room -> ShowS
$cshowsPrec :: Int -> Room -> ShowS
Prelude.Show, (forall x. Room -> Rep Room x)
-> (forall x. Rep Room x -> Room) -> Generic Room
forall x. Rep Room x -> Room
forall x. Room -> Rep Room x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Room x -> Room
$cfrom :: forall x. Room -> Rep Room x
Prelude.Generic)

-- |
-- Create a value of 'Room' 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:
--
-- 'profileArn', 'room_profileArn' - The profile ARN of a room.
--
-- 'providerCalendarId', 'room_providerCalendarId' - The provider calendar ARN of a room.
--
-- 'roomArn', 'room_roomArn' - The ARN of a room.
--
-- 'roomName', 'room_roomName' - The name of a room.
--
-- 'description', 'room_description' - The description of a room.
newRoom ::
  Room
newRoom :: Room
newRoom =
  Room' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Room
Room'
    { $sel:profileArn:Room' :: Maybe Text
profileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:providerCalendarId:Room' :: Maybe Text
providerCalendarId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roomArn:Room' :: Maybe Text
roomArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roomName:Room' :: Maybe Text
roomName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Room' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The profile ARN of a room.
room_profileArn :: Lens.Lens' Room (Prelude.Maybe Prelude.Text)
room_profileArn :: (Maybe Text -> f (Maybe Text)) -> Room -> f Room
room_profileArn = (Room -> Maybe Text)
-> (Room -> Maybe Text -> Room)
-> Lens Room Room (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Room' {Maybe Text
profileArn :: Maybe Text
$sel:profileArn:Room' :: Room -> Maybe Text
profileArn} -> Maybe Text
profileArn) (\s :: Room
s@Room' {} Maybe Text
a -> Room
s {$sel:profileArn:Room' :: Maybe Text
profileArn = Maybe Text
a} :: Room)

-- | The provider calendar ARN of a room.
room_providerCalendarId :: Lens.Lens' Room (Prelude.Maybe Prelude.Text)
room_providerCalendarId :: (Maybe Text -> f (Maybe Text)) -> Room -> f Room
room_providerCalendarId = (Room -> Maybe Text)
-> (Room -> Maybe Text -> Room)
-> Lens Room Room (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Room' {Maybe Text
providerCalendarId :: Maybe Text
$sel:providerCalendarId:Room' :: Room -> Maybe Text
providerCalendarId} -> Maybe Text
providerCalendarId) (\s :: Room
s@Room' {} Maybe Text
a -> Room
s {$sel:providerCalendarId:Room' :: Maybe Text
providerCalendarId = Maybe Text
a} :: Room)

-- | The ARN of a room.
room_roomArn :: Lens.Lens' Room (Prelude.Maybe Prelude.Text)
room_roomArn :: (Maybe Text -> f (Maybe Text)) -> Room -> f Room
room_roomArn = (Room -> Maybe Text)
-> (Room -> Maybe Text -> Room)
-> Lens Room Room (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Room' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:Room' :: Room -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: Room
s@Room' {} Maybe Text
a -> Room
s {$sel:roomArn:Room' :: Maybe Text
roomArn = Maybe Text
a} :: Room)

-- | The name of a room.
room_roomName :: Lens.Lens' Room (Prelude.Maybe Prelude.Text)
room_roomName :: (Maybe Text -> f (Maybe Text)) -> Room -> f Room
room_roomName = (Room -> Maybe Text)
-> (Room -> Maybe Text -> Room)
-> Lens Room Room (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Room' {Maybe Text
roomName :: Maybe Text
$sel:roomName:Room' :: Room -> Maybe Text
roomName} -> Maybe Text
roomName) (\s :: Room
s@Room' {} Maybe Text
a -> Room
s {$sel:roomName:Room' :: Maybe Text
roomName = Maybe Text
a} :: Room)

-- | The description of a room.
room_description :: Lens.Lens' Room (Prelude.Maybe Prelude.Text)
room_description :: (Maybe Text -> f (Maybe Text)) -> Room -> f Room
room_description = (Room -> Maybe Text)
-> (Room -> Maybe Text -> Room)
-> Lens Room Room (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Room' {Maybe Text
description :: Maybe Text
$sel:description:Room' :: Room -> Maybe Text
description} -> Maybe Text
description) (\s :: Room
s@Room' {} Maybe Text
a -> Room
s {$sel:description:Room' :: Maybe Text
description = Maybe Text
a} :: Room)

instance Core.FromJSON Room where
  parseJSON :: Value -> Parser Room
parseJSON =
    String -> (Object -> Parser Room) -> Value -> Parser Room
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Room"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Room
Room'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Room)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Room)
forall (f :: * -> *) a b. Functor 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
"ProfileArn")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Room)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Room)
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
"ProviderCalendarId")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> Room)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Maybe Text -> Room)
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
"RoomArn")
            Parser (Maybe Text -> Maybe Text -> Room)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Room)
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
"RoomName")
            Parser (Maybe Text -> Room) -> Parser (Maybe Text) -> Parser Room
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
"Description")
      )

instance Prelude.Hashable Room

instance Prelude.NFData Room