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

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

-- | Settings for the instant booking feature that are applied to a room
-- profile. When users start their meeting with Alexa, Alexa automatically
-- books the room for the configured duration if the room is available.
--
-- /See:/ 'newInstantBooking' smart constructor.
data InstantBooking = InstantBooking'
  { -- | Duration between 15 and 240 minutes at increments of 15 that determines
    -- how long to book an available room when a meeting is started with Alexa.
    InstantBooking -> Maybe Int
durationInMinutes :: Prelude.Maybe Prelude.Int,
    -- | Whether instant booking is enabled or not.
    InstantBooking -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (InstantBooking -> InstantBooking -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstantBooking -> InstantBooking -> Bool
$c/= :: InstantBooking -> InstantBooking -> Bool
== :: InstantBooking -> InstantBooking -> Bool
$c== :: InstantBooking -> InstantBooking -> Bool
Prelude.Eq, ReadPrec [InstantBooking]
ReadPrec InstantBooking
Int -> ReadS InstantBooking
ReadS [InstantBooking]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstantBooking]
$creadListPrec :: ReadPrec [InstantBooking]
readPrec :: ReadPrec InstantBooking
$creadPrec :: ReadPrec InstantBooking
readList :: ReadS [InstantBooking]
$creadList :: ReadS [InstantBooking]
readsPrec :: Int -> ReadS InstantBooking
$creadsPrec :: Int -> ReadS InstantBooking
Prelude.Read, Int -> InstantBooking -> ShowS
[InstantBooking] -> ShowS
InstantBooking -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstantBooking] -> ShowS
$cshowList :: [InstantBooking] -> ShowS
show :: InstantBooking -> String
$cshow :: InstantBooking -> String
showsPrec :: Int -> InstantBooking -> ShowS
$cshowsPrec :: Int -> InstantBooking -> ShowS
Prelude.Show, forall x. Rep InstantBooking x -> InstantBooking
forall x. InstantBooking -> Rep InstantBooking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstantBooking x -> InstantBooking
$cfrom :: forall x. InstantBooking -> Rep InstantBooking x
Prelude.Generic)

-- |
-- Create a value of 'InstantBooking' 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:
--
-- 'durationInMinutes', 'instantBooking_durationInMinutes' - Duration between 15 and 240 minutes at increments of 15 that determines
-- how long to book an available room when a meeting is started with Alexa.
--
-- 'enabled', 'instantBooking_enabled' - Whether instant booking is enabled or not.
newInstantBooking ::
  InstantBooking
newInstantBooking :: InstantBooking
newInstantBooking =
  InstantBooking'
    { $sel:durationInMinutes:InstantBooking' :: Maybe Int
durationInMinutes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:InstantBooking' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing
    }

-- | Duration between 15 and 240 minutes at increments of 15 that determines
-- how long to book an available room when a meeting is started with Alexa.
instantBooking_durationInMinutes :: Lens.Lens' InstantBooking (Prelude.Maybe Prelude.Int)
instantBooking_durationInMinutes :: Lens' InstantBooking (Maybe Int)
instantBooking_durationInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstantBooking' {Maybe Int
durationInMinutes :: Maybe Int
$sel:durationInMinutes:InstantBooking' :: InstantBooking -> Maybe Int
durationInMinutes} -> Maybe Int
durationInMinutes) (\s :: InstantBooking
s@InstantBooking' {} Maybe Int
a -> InstantBooking
s {$sel:durationInMinutes:InstantBooking' :: Maybe Int
durationInMinutes = Maybe Int
a} :: InstantBooking)

-- | Whether instant booking is enabled or not.
instantBooking_enabled :: Lens.Lens' InstantBooking (Prelude.Maybe Prelude.Bool)
instantBooking_enabled :: Lens' InstantBooking (Maybe Bool)
instantBooking_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstantBooking' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:InstantBooking' :: InstantBooking -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: InstantBooking
s@InstantBooking' {} Maybe Bool
a -> InstantBooking
s {$sel:enabled:InstantBooking' :: Maybe Bool
enabled = Maybe Bool
a} :: InstantBooking)

instance Data.FromJSON InstantBooking where
  parseJSON :: Value -> Parser InstantBooking
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstantBooking"
      ( \Object
x ->
          Maybe Int -> Maybe Bool -> InstantBooking
InstantBooking'
            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
"DurationInMinutes")
            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
"Enabled")
      )

instance Prelude.Hashable InstantBooking where
  hashWithSalt :: Int -> InstantBooking -> Int
hashWithSalt Int
_salt InstantBooking' {Maybe Bool
Maybe Int
enabled :: Maybe Bool
durationInMinutes :: Maybe Int
$sel:enabled:InstantBooking' :: InstantBooking -> Maybe Bool
$sel:durationInMinutes:InstantBooking' :: InstantBooking -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
durationInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled

instance Prelude.NFData InstantBooking where
  rnf :: InstantBooking -> ()
rnf InstantBooking' {Maybe Bool
Maybe Int
enabled :: Maybe Bool
durationInMinutes :: Maybe Int
$sel:enabled:InstantBooking' :: InstantBooking -> Maybe Bool
$sel:durationInMinutes:InstantBooking' :: InstantBooking -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
durationInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled