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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | Whether instant booking is enabled or not.
    UpdateInstantBooking -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | 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
  }
  deriving (UpdateInstantBooking -> UpdateInstantBooking -> Bool
(UpdateInstantBooking -> UpdateInstantBooking -> Bool)
-> (UpdateInstantBooking -> UpdateInstantBooking -> Bool)
-> Eq UpdateInstantBooking
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]
(Int -> ReadS UpdateInstantBooking)
-> ReadS [UpdateInstantBooking]
-> ReadPrec UpdateInstantBooking
-> ReadPrec [UpdateInstantBooking]
-> Read 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
(Int -> UpdateInstantBooking -> ShowS)
-> (UpdateInstantBooking -> String)
-> ([UpdateInstantBooking] -> ShowS)
-> Show UpdateInstantBooking
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. UpdateInstantBooking -> Rep UpdateInstantBooking x)
-> (forall x. Rep UpdateInstantBooking x -> UpdateInstantBooking)
-> Generic UpdateInstantBooking
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:
--
-- 'enabled', 'updateInstantBooking_enabled' - Whether instant booking is enabled or not.
--
-- '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.
newUpdateInstantBooking ::
  UpdateInstantBooking
newUpdateInstantBooking :: UpdateInstantBooking
newUpdateInstantBooking =
  UpdateInstantBooking' :: Maybe Bool -> Maybe Int -> UpdateInstantBooking
UpdateInstantBooking'
    { $sel:enabled:UpdateInstantBooking' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:durationInMinutes:UpdateInstantBooking' :: Maybe Int
durationInMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether instant booking is enabled or not.
updateInstantBooking_enabled :: Lens.Lens' UpdateInstantBooking (Prelude.Maybe Prelude.Bool)
updateInstantBooking_enabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateInstantBooking -> f UpdateInstantBooking
updateInstantBooking_enabled = (UpdateInstantBooking -> Maybe Bool)
-> (UpdateInstantBooking -> Maybe Bool -> UpdateInstantBooking)
-> Lens
     UpdateInstantBooking UpdateInstantBooking (Maybe Bool) (Maybe Bool)
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)

-- | 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 :: (Maybe Int -> f (Maybe Int))
-> UpdateInstantBooking -> f UpdateInstantBooking
updateInstantBooking_durationInMinutes = (UpdateInstantBooking -> Maybe Int)
-> (UpdateInstantBooking -> Maybe Int -> UpdateInstantBooking)
-> Lens
     UpdateInstantBooking UpdateInstantBooking (Maybe Int) (Maybe Int)
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)

instance Prelude.Hashable UpdateInstantBooking

instance Prelude.NFData UpdateInstantBooking

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