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

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

-- | Updates settings for the require check in feature that are applied to a
-- room profile. Require check in allows a meeting room’s Alexa or AVS
-- device to prompt the user to check in; otherwise, the room will be
-- released.
--
-- /See:/ 'newUpdateRequireCheckIn' smart constructor.
data UpdateRequireCheckIn = UpdateRequireCheckIn'
  { -- | Whether require check in is enabled or not.
    UpdateRequireCheckIn -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | Duration between 5 and 20 minutes to determine when to release the room
    -- if it\'s not checked into.
    UpdateRequireCheckIn -> Maybe Int
releaseAfterMinutes :: Prelude.Maybe Prelude.Int
  }
  deriving (UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool
(UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool)
-> (UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool)
-> Eq UpdateRequireCheckIn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool
$c/= :: UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool
== :: UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool
$c== :: UpdateRequireCheckIn -> UpdateRequireCheckIn -> Bool
Prelude.Eq, ReadPrec [UpdateRequireCheckIn]
ReadPrec UpdateRequireCheckIn
Int -> ReadS UpdateRequireCheckIn
ReadS [UpdateRequireCheckIn]
(Int -> ReadS UpdateRequireCheckIn)
-> ReadS [UpdateRequireCheckIn]
-> ReadPrec UpdateRequireCheckIn
-> ReadPrec [UpdateRequireCheckIn]
-> Read UpdateRequireCheckIn
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRequireCheckIn]
$creadListPrec :: ReadPrec [UpdateRequireCheckIn]
readPrec :: ReadPrec UpdateRequireCheckIn
$creadPrec :: ReadPrec UpdateRequireCheckIn
readList :: ReadS [UpdateRequireCheckIn]
$creadList :: ReadS [UpdateRequireCheckIn]
readsPrec :: Int -> ReadS UpdateRequireCheckIn
$creadsPrec :: Int -> ReadS UpdateRequireCheckIn
Prelude.Read, Int -> UpdateRequireCheckIn -> ShowS
[UpdateRequireCheckIn] -> ShowS
UpdateRequireCheckIn -> String
(Int -> UpdateRequireCheckIn -> ShowS)
-> (UpdateRequireCheckIn -> String)
-> ([UpdateRequireCheckIn] -> ShowS)
-> Show UpdateRequireCheckIn
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRequireCheckIn] -> ShowS
$cshowList :: [UpdateRequireCheckIn] -> ShowS
show :: UpdateRequireCheckIn -> String
$cshow :: UpdateRequireCheckIn -> String
showsPrec :: Int -> UpdateRequireCheckIn -> ShowS
$cshowsPrec :: Int -> UpdateRequireCheckIn -> ShowS
Prelude.Show, (forall x. UpdateRequireCheckIn -> Rep UpdateRequireCheckIn x)
-> (forall x. Rep UpdateRequireCheckIn x -> UpdateRequireCheckIn)
-> Generic UpdateRequireCheckIn
forall x. Rep UpdateRequireCheckIn x -> UpdateRequireCheckIn
forall x. UpdateRequireCheckIn -> Rep UpdateRequireCheckIn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRequireCheckIn x -> UpdateRequireCheckIn
$cfrom :: forall x. UpdateRequireCheckIn -> Rep UpdateRequireCheckIn x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRequireCheckIn' 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', 'updateRequireCheckIn_enabled' - Whether require check in is enabled or not.
--
-- 'releaseAfterMinutes', 'updateRequireCheckIn_releaseAfterMinutes' - Duration between 5 and 20 minutes to determine when to release the room
-- if it\'s not checked into.
newUpdateRequireCheckIn ::
  UpdateRequireCheckIn
newUpdateRequireCheckIn :: UpdateRequireCheckIn
newUpdateRequireCheckIn =
  UpdateRequireCheckIn' :: Maybe Bool -> Maybe Int -> UpdateRequireCheckIn
UpdateRequireCheckIn'
    { $sel:enabled:UpdateRequireCheckIn' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:releaseAfterMinutes:UpdateRequireCheckIn' :: Maybe Int
releaseAfterMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether require check in is enabled or not.
updateRequireCheckIn_enabled :: Lens.Lens' UpdateRequireCheckIn (Prelude.Maybe Prelude.Bool)
updateRequireCheckIn_enabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateRequireCheckIn -> f UpdateRequireCheckIn
updateRequireCheckIn_enabled = (UpdateRequireCheckIn -> Maybe Bool)
-> (UpdateRequireCheckIn -> Maybe Bool -> UpdateRequireCheckIn)
-> Lens
     UpdateRequireCheckIn UpdateRequireCheckIn (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRequireCheckIn' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateRequireCheckIn' :: UpdateRequireCheckIn -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateRequireCheckIn
s@UpdateRequireCheckIn' {} Maybe Bool
a -> UpdateRequireCheckIn
s {$sel:enabled:UpdateRequireCheckIn' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateRequireCheckIn)

-- | Duration between 5 and 20 minutes to determine when to release the room
-- if it\'s not checked into.
updateRequireCheckIn_releaseAfterMinutes :: Lens.Lens' UpdateRequireCheckIn (Prelude.Maybe Prelude.Int)
updateRequireCheckIn_releaseAfterMinutes :: (Maybe Int -> f (Maybe Int))
-> UpdateRequireCheckIn -> f UpdateRequireCheckIn
updateRequireCheckIn_releaseAfterMinutes = (UpdateRequireCheckIn -> Maybe Int)
-> (UpdateRequireCheckIn -> Maybe Int -> UpdateRequireCheckIn)
-> Lens
     UpdateRequireCheckIn UpdateRequireCheckIn (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRequireCheckIn' {Maybe Int
releaseAfterMinutes :: Maybe Int
$sel:releaseAfterMinutes:UpdateRequireCheckIn' :: UpdateRequireCheckIn -> Maybe Int
releaseAfterMinutes} -> Maybe Int
releaseAfterMinutes) (\s :: UpdateRequireCheckIn
s@UpdateRequireCheckIn' {} Maybe Int
a -> UpdateRequireCheckIn
s {$sel:releaseAfterMinutes:UpdateRequireCheckIn' :: Maybe Int
releaseAfterMinutes = Maybe Int
a} :: UpdateRequireCheckIn)

instance Prelude.Hashable UpdateRequireCheckIn

instance Prelude.NFData UpdateRequireCheckIn

instance Core.ToJSON UpdateRequireCheckIn where
  toJSON :: UpdateRequireCheckIn -> Value
toJSON UpdateRequireCheckIn' {Maybe Bool
Maybe Int
releaseAfterMinutes :: Maybe Int
enabled :: Maybe Bool
$sel:releaseAfterMinutes:UpdateRequireCheckIn' :: UpdateRequireCheckIn -> Maybe Int
$sel:enabled:UpdateRequireCheckIn' :: UpdateRequireCheckIn -> 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
"ReleaseAfterMinutes" 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
releaseAfterMinutes
          ]
      )