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

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

-- | 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:/ 'newEndOfMeetingReminder' smart constructor.
data EndOfMeetingReminder = EndOfMeetingReminder'
  { -- | Whether an end of meeting reminder is enabled or not.
    EndOfMeetingReminder -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | A range of 3 to 15 minutes that determines when the reminder begins.
    EndOfMeetingReminder -> Maybe (NonEmpty Int)
reminderAtMinutes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Int),
    -- | The type of sound that users hear during the end of meeting reminder.
    EndOfMeetingReminder -> Maybe EndOfMeetingReminderType
reminderType :: Prelude.Maybe EndOfMeetingReminderType
  }
  deriving (EndOfMeetingReminder -> EndOfMeetingReminder -> Bool
(EndOfMeetingReminder -> EndOfMeetingReminder -> Bool)
-> (EndOfMeetingReminder -> EndOfMeetingReminder -> Bool)
-> Eq EndOfMeetingReminder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndOfMeetingReminder -> EndOfMeetingReminder -> Bool
$c/= :: EndOfMeetingReminder -> EndOfMeetingReminder -> Bool
== :: EndOfMeetingReminder -> EndOfMeetingReminder -> Bool
$c== :: EndOfMeetingReminder -> EndOfMeetingReminder -> Bool
Prelude.Eq, ReadPrec [EndOfMeetingReminder]
ReadPrec EndOfMeetingReminder
Int -> ReadS EndOfMeetingReminder
ReadS [EndOfMeetingReminder]
(Int -> ReadS EndOfMeetingReminder)
-> ReadS [EndOfMeetingReminder]
-> ReadPrec EndOfMeetingReminder
-> ReadPrec [EndOfMeetingReminder]
-> Read EndOfMeetingReminder
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndOfMeetingReminder]
$creadListPrec :: ReadPrec [EndOfMeetingReminder]
readPrec :: ReadPrec EndOfMeetingReminder
$creadPrec :: ReadPrec EndOfMeetingReminder
readList :: ReadS [EndOfMeetingReminder]
$creadList :: ReadS [EndOfMeetingReminder]
readsPrec :: Int -> ReadS EndOfMeetingReminder
$creadsPrec :: Int -> ReadS EndOfMeetingReminder
Prelude.Read, Int -> EndOfMeetingReminder -> ShowS
[EndOfMeetingReminder] -> ShowS
EndOfMeetingReminder -> String
(Int -> EndOfMeetingReminder -> ShowS)
-> (EndOfMeetingReminder -> String)
-> ([EndOfMeetingReminder] -> ShowS)
-> Show EndOfMeetingReminder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndOfMeetingReminder] -> ShowS
$cshowList :: [EndOfMeetingReminder] -> ShowS
show :: EndOfMeetingReminder -> String
$cshow :: EndOfMeetingReminder -> String
showsPrec :: Int -> EndOfMeetingReminder -> ShowS
$cshowsPrec :: Int -> EndOfMeetingReminder -> ShowS
Prelude.Show, (forall x. EndOfMeetingReminder -> Rep EndOfMeetingReminder x)
-> (forall x. Rep EndOfMeetingReminder x -> EndOfMeetingReminder)
-> Generic EndOfMeetingReminder
forall x. Rep EndOfMeetingReminder x -> EndOfMeetingReminder
forall x. EndOfMeetingReminder -> Rep EndOfMeetingReminder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndOfMeetingReminder x -> EndOfMeetingReminder
$cfrom :: forall x. EndOfMeetingReminder -> Rep EndOfMeetingReminder x
Prelude.Generic)

-- |
-- Create a value of 'EndOfMeetingReminder' 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', 'endOfMeetingReminder_enabled' - Whether an end of meeting reminder is enabled or not.
--
-- 'reminderAtMinutes', 'endOfMeetingReminder_reminderAtMinutes' - A range of 3 to 15 minutes that determines when the reminder begins.
--
-- 'reminderType', 'endOfMeetingReminder_reminderType' - The type of sound that users hear during the end of meeting reminder.
newEndOfMeetingReminder ::
  EndOfMeetingReminder
newEndOfMeetingReminder :: EndOfMeetingReminder
newEndOfMeetingReminder =
  EndOfMeetingReminder' :: Maybe Bool
-> Maybe (NonEmpty Int)
-> Maybe EndOfMeetingReminderType
-> EndOfMeetingReminder
EndOfMeetingReminder'
    { $sel:enabled:EndOfMeetingReminder' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:reminderAtMinutes:EndOfMeetingReminder' :: Maybe (NonEmpty Int)
reminderAtMinutes = Maybe (NonEmpty Int)
forall a. Maybe a
Prelude.Nothing,
      $sel:reminderType:EndOfMeetingReminder' :: Maybe EndOfMeetingReminderType
reminderType = Maybe EndOfMeetingReminderType
forall a. Maybe a
Prelude.Nothing
    }

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

-- | A range of 3 to 15 minutes that determines when the reminder begins.
endOfMeetingReminder_reminderAtMinutes :: Lens.Lens' EndOfMeetingReminder (Prelude.Maybe (Prelude.NonEmpty Prelude.Int))
endOfMeetingReminder_reminderAtMinutes :: (Maybe (NonEmpty Int) -> f (Maybe (NonEmpty Int)))
-> EndOfMeetingReminder -> f EndOfMeetingReminder
endOfMeetingReminder_reminderAtMinutes = (EndOfMeetingReminder -> Maybe (NonEmpty Int))
-> (EndOfMeetingReminder
    -> Maybe (NonEmpty Int) -> EndOfMeetingReminder)
-> Lens
     EndOfMeetingReminder
     EndOfMeetingReminder
     (Maybe (NonEmpty Int))
     (Maybe (NonEmpty Int))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndOfMeetingReminder' {Maybe (NonEmpty Int)
reminderAtMinutes :: Maybe (NonEmpty Int)
$sel:reminderAtMinutes:EndOfMeetingReminder' :: EndOfMeetingReminder -> Maybe (NonEmpty Int)
reminderAtMinutes} -> Maybe (NonEmpty Int)
reminderAtMinutes) (\s :: EndOfMeetingReminder
s@EndOfMeetingReminder' {} Maybe (NonEmpty Int)
a -> EndOfMeetingReminder
s {$sel:reminderAtMinutes:EndOfMeetingReminder' :: Maybe (NonEmpty Int)
reminderAtMinutes = Maybe (NonEmpty Int)
a} :: EndOfMeetingReminder) ((Maybe (NonEmpty Int) -> f (Maybe (NonEmpty Int)))
 -> EndOfMeetingReminder -> f EndOfMeetingReminder)
-> ((Maybe (NonEmpty Int) -> f (Maybe (NonEmpty Int)))
    -> Maybe (NonEmpty Int) -> f (Maybe (NonEmpty Int)))
-> (Maybe (NonEmpty Int) -> f (Maybe (NonEmpty Int)))
-> EndOfMeetingReminder
-> f EndOfMeetingReminder
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Int) (NonEmpty Int) (NonEmpty Int) (NonEmpty Int)
-> Iso
     (Maybe (NonEmpty Int))
     (Maybe (NonEmpty Int))
     (Maybe (NonEmpty Int))
     (Maybe (NonEmpty Int))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (NonEmpty Int) (NonEmpty Int) (NonEmpty Int) (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.
endOfMeetingReminder_reminderType :: Lens.Lens' EndOfMeetingReminder (Prelude.Maybe EndOfMeetingReminderType)
endOfMeetingReminder_reminderType :: (Maybe EndOfMeetingReminderType
 -> f (Maybe EndOfMeetingReminderType))
-> EndOfMeetingReminder -> f EndOfMeetingReminder
endOfMeetingReminder_reminderType = (EndOfMeetingReminder -> Maybe EndOfMeetingReminderType)
-> (EndOfMeetingReminder
    -> Maybe EndOfMeetingReminderType -> EndOfMeetingReminder)
-> Lens
     EndOfMeetingReminder
     EndOfMeetingReminder
     (Maybe EndOfMeetingReminderType)
     (Maybe EndOfMeetingReminderType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndOfMeetingReminder' {Maybe EndOfMeetingReminderType
reminderType :: Maybe EndOfMeetingReminderType
$sel:reminderType:EndOfMeetingReminder' :: EndOfMeetingReminder -> Maybe EndOfMeetingReminderType
reminderType} -> Maybe EndOfMeetingReminderType
reminderType) (\s :: EndOfMeetingReminder
s@EndOfMeetingReminder' {} Maybe EndOfMeetingReminderType
a -> EndOfMeetingReminder
s {$sel:reminderType:EndOfMeetingReminder' :: Maybe EndOfMeetingReminderType
reminderType = Maybe EndOfMeetingReminderType
a} :: EndOfMeetingReminder)

instance Core.FromJSON EndOfMeetingReminder where
  parseJSON :: Value -> Parser EndOfMeetingReminder
parseJSON =
    String
-> (Object -> Parser EndOfMeetingReminder)
-> Value
-> Parser EndOfMeetingReminder
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EndOfMeetingReminder"
      ( \Object
x ->
          Maybe Bool
-> Maybe (NonEmpty Int)
-> Maybe EndOfMeetingReminderType
-> EndOfMeetingReminder
EndOfMeetingReminder'
            (Maybe Bool
 -> Maybe (NonEmpty Int)
 -> Maybe EndOfMeetingReminderType
 -> EndOfMeetingReminder)
-> Parser (Maybe Bool)
-> Parser
     (Maybe (NonEmpty Int)
      -> Maybe EndOfMeetingReminderType -> EndOfMeetingReminder)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
            Parser
  (Maybe (NonEmpty Int)
   -> Maybe EndOfMeetingReminderType -> EndOfMeetingReminder)
-> Parser (Maybe (NonEmpty Int))
-> Parser (Maybe EndOfMeetingReminderType -> EndOfMeetingReminder)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Int))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReminderAtMinutes")
            Parser (Maybe EndOfMeetingReminderType -> EndOfMeetingReminder)
-> Parser (Maybe EndOfMeetingReminderType)
-> Parser EndOfMeetingReminder
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EndOfMeetingReminderType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReminderType")
      )

instance Prelude.Hashable EndOfMeetingReminder

instance Prelude.NFData EndOfMeetingReminder