{-# 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 #-}
module Amazonka.AlexaBusiness.Types.RequireCheckIn where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RequireCheckIn = RequireCheckIn'
{
RequireCheckIn -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
RequireCheckIn -> Maybe Int
releaseAfterMinutes :: Prelude.Maybe Prelude.Int
}
deriving (RequireCheckIn -> RequireCheckIn -> Bool
(RequireCheckIn -> RequireCheckIn -> Bool)
-> (RequireCheckIn -> RequireCheckIn -> Bool) -> Eq RequireCheckIn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequireCheckIn -> RequireCheckIn -> Bool
$c/= :: RequireCheckIn -> RequireCheckIn -> Bool
== :: RequireCheckIn -> RequireCheckIn -> Bool
$c== :: RequireCheckIn -> RequireCheckIn -> Bool
Prelude.Eq, ReadPrec [RequireCheckIn]
ReadPrec RequireCheckIn
Int -> ReadS RequireCheckIn
ReadS [RequireCheckIn]
(Int -> ReadS RequireCheckIn)
-> ReadS [RequireCheckIn]
-> ReadPrec RequireCheckIn
-> ReadPrec [RequireCheckIn]
-> Read RequireCheckIn
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RequireCheckIn]
$creadListPrec :: ReadPrec [RequireCheckIn]
readPrec :: ReadPrec RequireCheckIn
$creadPrec :: ReadPrec RequireCheckIn
readList :: ReadS [RequireCheckIn]
$creadList :: ReadS [RequireCheckIn]
readsPrec :: Int -> ReadS RequireCheckIn
$creadsPrec :: Int -> ReadS RequireCheckIn
Prelude.Read, Int -> RequireCheckIn -> ShowS
[RequireCheckIn] -> ShowS
RequireCheckIn -> String
(Int -> RequireCheckIn -> ShowS)
-> (RequireCheckIn -> String)
-> ([RequireCheckIn] -> ShowS)
-> Show RequireCheckIn
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequireCheckIn] -> ShowS
$cshowList :: [RequireCheckIn] -> ShowS
show :: RequireCheckIn -> String
$cshow :: RequireCheckIn -> String
showsPrec :: Int -> RequireCheckIn -> ShowS
$cshowsPrec :: Int -> RequireCheckIn -> ShowS
Prelude.Show, (forall x. RequireCheckIn -> Rep RequireCheckIn x)
-> (forall x. Rep RequireCheckIn x -> RequireCheckIn)
-> Generic RequireCheckIn
forall x. Rep RequireCheckIn x -> RequireCheckIn
forall x. RequireCheckIn -> Rep RequireCheckIn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RequireCheckIn x -> RequireCheckIn
$cfrom :: forall x. RequireCheckIn -> Rep RequireCheckIn x
Prelude.Generic)
newRequireCheckIn ::
RequireCheckIn
newRequireCheckIn :: RequireCheckIn
newRequireCheckIn =
RequireCheckIn' :: Maybe Bool -> Maybe Int -> RequireCheckIn
RequireCheckIn'
{ $sel:enabled:RequireCheckIn' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:releaseAfterMinutes:RequireCheckIn' :: Maybe Int
releaseAfterMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
requireCheckIn_enabled :: Lens.Lens' RequireCheckIn (Prelude.Maybe Prelude.Bool)
requireCheckIn_enabled :: (Maybe Bool -> f (Maybe Bool))
-> RequireCheckIn -> f RequireCheckIn
requireCheckIn_enabled = (RequireCheckIn -> Maybe Bool)
-> (RequireCheckIn -> Maybe Bool -> RequireCheckIn)
-> Lens RequireCheckIn RequireCheckIn (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequireCheckIn' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:RequireCheckIn' :: RequireCheckIn -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: RequireCheckIn
s@RequireCheckIn' {} Maybe Bool
a -> RequireCheckIn
s {$sel:enabled:RequireCheckIn' :: Maybe Bool
enabled = Maybe Bool
a} :: RequireCheckIn)
requireCheckIn_releaseAfterMinutes :: Lens.Lens' RequireCheckIn (Prelude.Maybe Prelude.Int)
requireCheckIn_releaseAfterMinutes :: (Maybe Int -> f (Maybe Int)) -> RequireCheckIn -> f RequireCheckIn
requireCheckIn_releaseAfterMinutes = (RequireCheckIn -> Maybe Int)
-> (RequireCheckIn -> Maybe Int -> RequireCheckIn)
-> Lens RequireCheckIn RequireCheckIn (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequireCheckIn' {Maybe Int
releaseAfterMinutes :: Maybe Int
$sel:releaseAfterMinutes:RequireCheckIn' :: RequireCheckIn -> Maybe Int
releaseAfterMinutes} -> Maybe Int
releaseAfterMinutes) (\s :: RequireCheckIn
s@RequireCheckIn' {} Maybe Int
a -> RequireCheckIn
s {$sel:releaseAfterMinutes:RequireCheckIn' :: Maybe Int
releaseAfterMinutes = Maybe Int
a} :: RequireCheckIn)
instance Core.FromJSON RequireCheckIn where
parseJSON :: Value -> Parser RequireCheckIn
parseJSON =
String
-> (Object -> Parser RequireCheckIn)
-> Value
-> Parser RequireCheckIn
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RequireCheckIn"
( \Object
x ->
Maybe Bool -> Maybe Int -> RequireCheckIn
RequireCheckIn'
(Maybe Bool -> Maybe Int -> RequireCheckIn)
-> Parser (Maybe Bool) -> Parser (Maybe Int -> RequireCheckIn)
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 Int -> RequireCheckIn)
-> Parser (Maybe Int) -> Parser RequireCheckIn
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReleaseAfterMinutes")
)
instance Prelude.Hashable RequireCheckIn
instance Prelude.NFData RequireCheckIn