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

import Amazonka.AlexaBusiness.Types.EndOfMeetingReminderType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Creates settings for the end of meeting reminder feature that are
-- applied to a room profile. The end of meeting reminder enables Alexa to
-- remind users when a meeting is ending.
--
-- /See:/ 'newCreateEndOfMeetingReminder' smart constructor.
data CreateEndOfMeetingReminder = CreateEndOfMeetingReminder'
  { -- | A range of 3 to 15 minutes that determines when the reminder begins.
    CreateEndOfMeetingReminder -> NonEmpty Int
reminderAtMinutes :: Prelude.NonEmpty Prelude.Int,
    -- | The type of sound that users hear during the end of meeting reminder.
    CreateEndOfMeetingReminder -> EndOfMeetingReminderType
reminderType :: EndOfMeetingReminderType,
    -- | Whether an end of meeting reminder is enabled or not.
    CreateEndOfMeetingReminder -> Bool
enabled :: Prelude.Bool
  }
  deriving (CreateEndOfMeetingReminder -> CreateEndOfMeetingReminder -> Bool
(CreateEndOfMeetingReminder -> CreateEndOfMeetingReminder -> Bool)
-> (CreateEndOfMeetingReminder
    -> CreateEndOfMeetingReminder -> Bool)
-> Eq CreateEndOfMeetingReminder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEndOfMeetingReminder -> CreateEndOfMeetingReminder -> Bool
$c/= :: CreateEndOfMeetingReminder -> CreateEndOfMeetingReminder -> Bool
== :: CreateEndOfMeetingReminder -> CreateEndOfMeetingReminder -> Bool
$c== :: CreateEndOfMeetingReminder -> CreateEndOfMeetingReminder -> Bool
Prelude.Eq, ReadPrec [CreateEndOfMeetingReminder]
ReadPrec CreateEndOfMeetingReminder
Int -> ReadS CreateEndOfMeetingReminder
ReadS [CreateEndOfMeetingReminder]
(Int -> ReadS CreateEndOfMeetingReminder)
-> ReadS [CreateEndOfMeetingReminder]
-> ReadPrec CreateEndOfMeetingReminder
-> ReadPrec [CreateEndOfMeetingReminder]
-> Read CreateEndOfMeetingReminder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEndOfMeetingReminder]
$creadListPrec :: ReadPrec [CreateEndOfMeetingReminder]
readPrec :: ReadPrec CreateEndOfMeetingReminder
$creadPrec :: ReadPrec CreateEndOfMeetingReminder
readList :: ReadS [CreateEndOfMeetingReminder]
$creadList :: ReadS [CreateEndOfMeetingReminder]
readsPrec :: Int -> ReadS CreateEndOfMeetingReminder
$creadsPrec :: Int -> ReadS CreateEndOfMeetingReminder
Prelude.Read, Int -> CreateEndOfMeetingReminder -> ShowS
[CreateEndOfMeetingReminder] -> ShowS
CreateEndOfMeetingReminder -> String
(Int -> CreateEndOfMeetingReminder -> ShowS)
-> (CreateEndOfMeetingReminder -> String)
-> ([CreateEndOfMeetingReminder] -> ShowS)
-> Show CreateEndOfMeetingReminder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEndOfMeetingReminder] -> ShowS
$cshowList :: [CreateEndOfMeetingReminder] -> ShowS
show :: CreateEndOfMeetingReminder -> String
$cshow :: CreateEndOfMeetingReminder -> String
showsPrec :: Int -> CreateEndOfMeetingReminder -> ShowS
$cshowsPrec :: Int -> CreateEndOfMeetingReminder -> ShowS
Prelude.Show, (forall x.
 CreateEndOfMeetingReminder -> Rep CreateEndOfMeetingReminder x)
-> (forall x.
    Rep CreateEndOfMeetingReminder x -> CreateEndOfMeetingReminder)
-> Generic CreateEndOfMeetingReminder
forall x.
Rep CreateEndOfMeetingReminder x -> CreateEndOfMeetingReminder
forall x.
CreateEndOfMeetingReminder -> Rep CreateEndOfMeetingReminder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEndOfMeetingReminder x -> CreateEndOfMeetingReminder
$cfrom :: forall x.
CreateEndOfMeetingReminder -> Rep CreateEndOfMeetingReminder x
Prelude.Generic)

-- |
-- Create a value of 'CreateEndOfMeetingReminder' 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:
--
-- 'reminderAtMinutes', 'createEndOfMeetingReminder_reminderAtMinutes' - A range of 3 to 15 minutes that determines when the reminder begins.
--
-- 'reminderType', 'createEndOfMeetingReminder_reminderType' - The type of sound that users hear during the end of meeting reminder.
--
-- 'enabled', 'createEndOfMeetingReminder_enabled' - Whether an end of meeting reminder is enabled or not.
newCreateEndOfMeetingReminder ::
  -- | 'reminderAtMinutes'
  Prelude.NonEmpty Prelude.Int ->
  -- | 'reminderType'
  EndOfMeetingReminderType ->
  -- | 'enabled'
  Prelude.Bool ->
  CreateEndOfMeetingReminder
newCreateEndOfMeetingReminder :: NonEmpty Int
-> EndOfMeetingReminderType -> Bool -> CreateEndOfMeetingReminder
newCreateEndOfMeetingReminder
  NonEmpty Int
pReminderAtMinutes_
  EndOfMeetingReminderType
pReminderType_
  Bool
pEnabled_ =
    CreateEndOfMeetingReminder' :: NonEmpty Int
-> EndOfMeetingReminderType -> Bool -> CreateEndOfMeetingReminder
CreateEndOfMeetingReminder'
      { $sel:reminderAtMinutes:CreateEndOfMeetingReminder' :: NonEmpty Int
reminderAtMinutes =
          Tagged (NonEmpty Int) (Identity (NonEmpty Int))
-> Tagged (NonEmpty Int) (Identity (NonEmpty Int))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Int) (Identity (NonEmpty Int))
 -> Tagged (NonEmpty Int) (Identity (NonEmpty Int)))
-> NonEmpty Int -> NonEmpty Int
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Int
pReminderAtMinutes_,
        $sel:reminderType:CreateEndOfMeetingReminder' :: EndOfMeetingReminderType
reminderType = EndOfMeetingReminderType
pReminderType_,
        $sel:enabled:CreateEndOfMeetingReminder' :: Bool
enabled = Bool
pEnabled_
      }

-- | A range of 3 to 15 minutes that determines when the reminder begins.
createEndOfMeetingReminder_reminderAtMinutes :: Lens.Lens' CreateEndOfMeetingReminder (Prelude.NonEmpty Prelude.Int)
createEndOfMeetingReminder_reminderAtMinutes :: (NonEmpty Int -> f (NonEmpty Int))
-> CreateEndOfMeetingReminder -> f CreateEndOfMeetingReminder
createEndOfMeetingReminder_reminderAtMinutes = (CreateEndOfMeetingReminder -> NonEmpty Int)
-> (CreateEndOfMeetingReminder
    -> NonEmpty Int -> CreateEndOfMeetingReminder)
-> Lens
     CreateEndOfMeetingReminder
     CreateEndOfMeetingReminder
     (NonEmpty Int)
     (NonEmpty Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndOfMeetingReminder' {NonEmpty Int
reminderAtMinutes :: NonEmpty Int
$sel:reminderAtMinutes:CreateEndOfMeetingReminder' :: CreateEndOfMeetingReminder -> NonEmpty Int
reminderAtMinutes} -> NonEmpty Int
reminderAtMinutes) (\s :: CreateEndOfMeetingReminder
s@CreateEndOfMeetingReminder' {} NonEmpty Int
a -> CreateEndOfMeetingReminder
s {$sel:reminderAtMinutes:CreateEndOfMeetingReminder' :: NonEmpty Int
reminderAtMinutes = NonEmpty Int
a} :: CreateEndOfMeetingReminder) ((NonEmpty Int -> f (NonEmpty Int))
 -> CreateEndOfMeetingReminder -> f CreateEndOfMeetingReminder)
-> ((NonEmpty Int -> f (NonEmpty Int))
    -> NonEmpty Int -> f (NonEmpty Int))
-> (NonEmpty Int -> f (NonEmpty Int))
-> CreateEndOfMeetingReminder
-> f CreateEndOfMeetingReminder
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Int -> f (NonEmpty Int))
-> NonEmpty Int -> f (NonEmpty Int)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The type of sound that users hear during the end of meeting reminder.
createEndOfMeetingReminder_reminderType :: Lens.Lens' CreateEndOfMeetingReminder EndOfMeetingReminderType
createEndOfMeetingReminder_reminderType :: (EndOfMeetingReminderType -> f EndOfMeetingReminderType)
-> CreateEndOfMeetingReminder -> f CreateEndOfMeetingReminder
createEndOfMeetingReminder_reminderType = (CreateEndOfMeetingReminder -> EndOfMeetingReminderType)
-> (CreateEndOfMeetingReminder
    -> EndOfMeetingReminderType -> CreateEndOfMeetingReminder)
-> Lens
     CreateEndOfMeetingReminder
     CreateEndOfMeetingReminder
     EndOfMeetingReminderType
     EndOfMeetingReminderType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndOfMeetingReminder' {EndOfMeetingReminderType
reminderType :: EndOfMeetingReminderType
$sel:reminderType:CreateEndOfMeetingReminder' :: CreateEndOfMeetingReminder -> EndOfMeetingReminderType
reminderType} -> EndOfMeetingReminderType
reminderType) (\s :: CreateEndOfMeetingReminder
s@CreateEndOfMeetingReminder' {} EndOfMeetingReminderType
a -> CreateEndOfMeetingReminder
s {$sel:reminderType:CreateEndOfMeetingReminder' :: EndOfMeetingReminderType
reminderType = EndOfMeetingReminderType
a} :: CreateEndOfMeetingReminder)

-- | Whether an end of meeting reminder is enabled or not.
createEndOfMeetingReminder_enabled :: Lens.Lens' CreateEndOfMeetingReminder Prelude.Bool
createEndOfMeetingReminder_enabled :: (Bool -> f Bool)
-> CreateEndOfMeetingReminder -> f CreateEndOfMeetingReminder
createEndOfMeetingReminder_enabled = (CreateEndOfMeetingReminder -> Bool)
-> (CreateEndOfMeetingReminder
    -> Bool -> CreateEndOfMeetingReminder)
-> Lens
     CreateEndOfMeetingReminder CreateEndOfMeetingReminder Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndOfMeetingReminder' {Bool
enabled :: Bool
$sel:enabled:CreateEndOfMeetingReminder' :: CreateEndOfMeetingReminder -> Bool
enabled} -> Bool
enabled) (\s :: CreateEndOfMeetingReminder
s@CreateEndOfMeetingReminder' {} Bool
a -> CreateEndOfMeetingReminder
s {$sel:enabled:CreateEndOfMeetingReminder' :: Bool
enabled = Bool
a} :: CreateEndOfMeetingReminder)

instance Prelude.Hashable CreateEndOfMeetingReminder

instance Prelude.NFData CreateEndOfMeetingReminder

instance Core.ToJSON CreateEndOfMeetingReminder where
  toJSON :: CreateEndOfMeetingReminder -> Value
toJSON CreateEndOfMeetingReminder' {Bool
NonEmpty Int
EndOfMeetingReminderType
enabled :: Bool
reminderType :: EndOfMeetingReminderType
reminderAtMinutes :: NonEmpty Int
$sel:enabled:CreateEndOfMeetingReminder' :: CreateEndOfMeetingReminder -> Bool
$sel:reminderType:CreateEndOfMeetingReminder' :: CreateEndOfMeetingReminder -> EndOfMeetingReminderType
$sel:reminderAtMinutes:CreateEndOfMeetingReminder' :: CreateEndOfMeetingReminder -> NonEmpty Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ReminderAtMinutes" Text -> NonEmpty Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Int
reminderAtMinutes),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ReminderType" Text -> EndOfMeetingReminderType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EndOfMeetingReminderType
reminderType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
enabled)
          ]
      )