{-# 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.UpdateInstantBooking
-- 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.UpdateInstantBooking 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

-- | Updates settings for the instant booking feature that are applied to a
-- room profile. If instant booking is enabled, Alexa automatically
-- reserves a room if it is free when a user joins a meeting with Alexa.
--
-- /See:/ 'newUpdateInstantBooking' smart constructor.
data UpdateInstantBooking = UpdateInstantBooking'
  { -- | 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.
    UpdateInstantBooking -> Maybe Int
durationInMinutes :: Prelude.Maybe Prelude.Int,
    -- | Whether instant booking is enabled or not.
    UpdateInstantBooking -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (UpdateInstantBooking -> UpdateInstantBooking -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
$c/= :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
== :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
$c== :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
Prelude.Eq, ReadPrec [UpdateInstantBooking]
ReadPrec UpdateInstantBooking
Int -> ReadS UpdateInstantBooking
ReadS [UpdateInstantBooking]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateInstantBooking]
$creadListPrec :: ReadPrec [UpdateInstantBooking]
readPrec :: ReadPrec UpdateInstantBooking
$creadPrec :: ReadPrec UpdateInstantBooking
readList :: ReadS [UpdateInstantBooking]
$creadList :: ReadS [UpdateInstantBooking]
readsPrec :: Int -> ReadS UpdateInstantBooking
$creadsPrec :: Int -> ReadS UpdateInstantBooking
Prelude.Read, Int -> UpdateInstantBooking -> ShowS
[UpdateInstantBooking] -> ShowS
UpdateInstantBooking -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateInstantBooking] -> ShowS
$cshowList :: [UpdateInstantBooking] -> ShowS
show :: UpdateInstantBooking -> String
$cshow :: UpdateInstantBooking -> String
showsPrec :: Int -> UpdateInstantBooking -> ShowS
$cshowsPrec :: Int -> UpdateInstantBooking -> ShowS
Prelude.Show, forall x. Rep UpdateInstantBooking x -> UpdateInstantBooking
forall x. UpdateInstantBooking -> Rep UpdateInstantBooking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateInstantBooking x -> UpdateInstantBooking
$cfrom :: forall x. UpdateInstantBooking -> Rep UpdateInstantBooking x
Prelude.Generic)

-- |
-- Create a value of 'UpdateInstantBooking' 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', 'updateInstantBooking_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', 'updateInstantBooking_enabled' - Whether instant booking is enabled or not.
newUpdateInstantBooking ::
  UpdateInstantBooking
newUpdateInstantBooking :: UpdateInstantBooking
newUpdateInstantBooking =
  UpdateInstantBooking'
    { $sel:durationInMinutes:UpdateInstantBooking' :: Maybe Int
durationInMinutes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:UpdateInstantBooking' :: 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.
updateInstantBooking_durationInMinutes :: Lens.Lens' UpdateInstantBooking (Prelude.Maybe Prelude.Int)
updateInstantBooking_durationInMinutes :: Lens' UpdateInstantBooking (Maybe Int)
updateInstantBooking_durationInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstantBooking' {Maybe Int
durationInMinutes :: Maybe Int
$sel:durationInMinutes:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Int
durationInMinutes} -> Maybe Int
durationInMinutes) (\s :: UpdateInstantBooking
s@UpdateInstantBooking' {} Maybe Int
a -> UpdateInstantBooking
s {$sel:durationInMinutes:UpdateInstantBooking' :: Maybe Int
durationInMinutes = Maybe Int
a} :: UpdateInstantBooking)

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

instance Prelude.Hashable UpdateInstantBooking where
  hashWithSalt :: Int -> UpdateInstantBooking -> Int
hashWithSalt Int
_salt UpdateInstantBooking' {Maybe Bool
Maybe Int
enabled :: Maybe Bool
durationInMinutes :: Maybe Int
$sel:enabled:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Bool
$sel:durationInMinutes:UpdateInstantBooking' :: UpdateInstantBooking -> 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 UpdateInstantBooking where
  rnf :: UpdateInstantBooking -> ()
rnf UpdateInstantBooking' {Maybe Bool
Maybe Int
enabled :: Maybe Bool
durationInMinutes :: Maybe Int
$sel:enabled:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Bool
$sel:durationInMinutes:UpdateInstantBooking' :: UpdateInstantBooking -> 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

instance Data.ToJSON UpdateInstantBooking where
  toJSON :: UpdateInstantBooking -> Value
toJSON UpdateInstantBooking' {Maybe Bool
Maybe Int
enabled :: Maybe Bool
durationInMinutes :: Maybe Int
$sel:enabled:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Bool
$sel:durationInMinutes:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DurationInMinutes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
durationInMinutes,
            (Key
"Enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled
          ]
      )