{-# 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.WorkMail.Types.BookingOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BookingOptions = BookingOptions'
{
BookingOptions -> Maybe Bool
autoDeclineConflictingRequests :: Prelude.Maybe Prelude.Bool,
BookingOptions -> Maybe Bool
autoDeclineRecurringRequests :: Prelude.Maybe Prelude.Bool,
BookingOptions -> Maybe Bool
autoAcceptRequests :: Prelude.Maybe Prelude.Bool
}
deriving (BookingOptions -> BookingOptions -> Bool
(BookingOptions -> BookingOptions -> Bool)
-> (BookingOptions -> BookingOptions -> Bool) -> Eq BookingOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BookingOptions -> BookingOptions -> Bool
$c/= :: BookingOptions -> BookingOptions -> Bool
== :: BookingOptions -> BookingOptions -> Bool
$c== :: BookingOptions -> BookingOptions -> Bool
Prelude.Eq, ReadPrec [BookingOptions]
ReadPrec BookingOptions
Int -> ReadS BookingOptions
ReadS [BookingOptions]
(Int -> ReadS BookingOptions)
-> ReadS [BookingOptions]
-> ReadPrec BookingOptions
-> ReadPrec [BookingOptions]
-> Read BookingOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BookingOptions]
$creadListPrec :: ReadPrec [BookingOptions]
readPrec :: ReadPrec BookingOptions
$creadPrec :: ReadPrec BookingOptions
readList :: ReadS [BookingOptions]
$creadList :: ReadS [BookingOptions]
readsPrec :: Int -> ReadS BookingOptions
$creadsPrec :: Int -> ReadS BookingOptions
Prelude.Read, Int -> BookingOptions -> ShowS
[BookingOptions] -> ShowS
BookingOptions -> String
(Int -> BookingOptions -> ShowS)
-> (BookingOptions -> String)
-> ([BookingOptions] -> ShowS)
-> Show BookingOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BookingOptions] -> ShowS
$cshowList :: [BookingOptions] -> ShowS
show :: BookingOptions -> String
$cshow :: BookingOptions -> String
showsPrec :: Int -> BookingOptions -> ShowS
$cshowsPrec :: Int -> BookingOptions -> ShowS
Prelude.Show, (forall x. BookingOptions -> Rep BookingOptions x)
-> (forall x. Rep BookingOptions x -> BookingOptions)
-> Generic BookingOptions
forall x. Rep BookingOptions x -> BookingOptions
forall x. BookingOptions -> Rep BookingOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BookingOptions x -> BookingOptions
$cfrom :: forall x. BookingOptions -> Rep BookingOptions x
Prelude.Generic)
newBookingOptions ::
BookingOptions
newBookingOptions :: BookingOptions
newBookingOptions =
BookingOptions' :: Maybe Bool -> Maybe Bool -> Maybe Bool -> BookingOptions
BookingOptions'
{ $sel:autoDeclineConflictingRequests:BookingOptions' :: Maybe Bool
autoDeclineConflictingRequests =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:autoDeclineRecurringRequests:BookingOptions' :: Maybe Bool
autoDeclineRecurringRequests = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:autoAcceptRequests:BookingOptions' :: Maybe Bool
autoAcceptRequests = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
bookingOptions_autoDeclineConflictingRequests :: Lens.Lens' BookingOptions (Prelude.Maybe Prelude.Bool)
bookingOptions_autoDeclineConflictingRequests :: (Maybe Bool -> f (Maybe Bool))
-> BookingOptions -> f BookingOptions
bookingOptions_autoDeclineConflictingRequests = (BookingOptions -> Maybe Bool)
-> (BookingOptions -> Maybe Bool -> BookingOptions)
-> Lens BookingOptions BookingOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BookingOptions' {Maybe Bool
autoDeclineConflictingRequests :: Maybe Bool
$sel:autoDeclineConflictingRequests:BookingOptions' :: BookingOptions -> Maybe Bool
autoDeclineConflictingRequests} -> Maybe Bool
autoDeclineConflictingRequests) (\s :: BookingOptions
s@BookingOptions' {} Maybe Bool
a -> BookingOptions
s {$sel:autoDeclineConflictingRequests:BookingOptions' :: Maybe Bool
autoDeclineConflictingRequests = Maybe Bool
a} :: BookingOptions)
bookingOptions_autoDeclineRecurringRequests :: Lens.Lens' BookingOptions (Prelude.Maybe Prelude.Bool)
bookingOptions_autoDeclineRecurringRequests :: (Maybe Bool -> f (Maybe Bool))
-> BookingOptions -> f BookingOptions
bookingOptions_autoDeclineRecurringRequests = (BookingOptions -> Maybe Bool)
-> (BookingOptions -> Maybe Bool -> BookingOptions)
-> Lens BookingOptions BookingOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BookingOptions' {Maybe Bool
autoDeclineRecurringRequests :: Maybe Bool
$sel:autoDeclineRecurringRequests:BookingOptions' :: BookingOptions -> Maybe Bool
autoDeclineRecurringRequests} -> Maybe Bool
autoDeclineRecurringRequests) (\s :: BookingOptions
s@BookingOptions' {} Maybe Bool
a -> BookingOptions
s {$sel:autoDeclineRecurringRequests:BookingOptions' :: Maybe Bool
autoDeclineRecurringRequests = Maybe Bool
a} :: BookingOptions)
bookingOptions_autoAcceptRequests :: Lens.Lens' BookingOptions (Prelude.Maybe Prelude.Bool)
bookingOptions_autoAcceptRequests :: (Maybe Bool -> f (Maybe Bool))
-> BookingOptions -> f BookingOptions
bookingOptions_autoAcceptRequests = (BookingOptions -> Maybe Bool)
-> (BookingOptions -> Maybe Bool -> BookingOptions)
-> Lens BookingOptions BookingOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BookingOptions' {Maybe Bool
autoAcceptRequests :: Maybe Bool
$sel:autoAcceptRequests:BookingOptions' :: BookingOptions -> Maybe Bool
autoAcceptRequests} -> Maybe Bool
autoAcceptRequests) (\s :: BookingOptions
s@BookingOptions' {} Maybe Bool
a -> BookingOptions
s {$sel:autoAcceptRequests:BookingOptions' :: Maybe Bool
autoAcceptRequests = Maybe Bool
a} :: BookingOptions)
instance Core.FromJSON BookingOptions where
parseJSON :: Value -> Parser BookingOptions
parseJSON =
String
-> (Object -> Parser BookingOptions)
-> Value
-> Parser BookingOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BookingOptions"
( \Object
x ->
Maybe Bool -> Maybe Bool -> Maybe Bool -> BookingOptions
BookingOptions'
(Maybe Bool -> Maybe Bool -> Maybe Bool -> BookingOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> Maybe Bool -> BookingOptions)
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
"AutoDeclineConflictingRequests")
Parser (Maybe Bool -> Maybe Bool -> BookingOptions)
-> Parser (Maybe Bool) -> Parser (Maybe Bool -> BookingOptions)
forall (f :: * -> *) a b. Applicative f => 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
"AutoDeclineRecurringRequests")
Parser (Maybe Bool -> BookingOptions)
-> Parser (Maybe Bool) -> Parser BookingOptions
forall (f :: * -> *) a b. Applicative f => 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
"AutoAcceptRequests")
)
instance Prelude.Hashable BookingOptions
instance Prelude.NFData BookingOptions
instance Core.ToJSON BookingOptions where
toJSON :: BookingOptions -> Value
toJSON BookingOptions' {Maybe Bool
autoAcceptRequests :: Maybe Bool
autoDeclineRecurringRequests :: Maybe Bool
autoDeclineConflictingRequests :: Maybe Bool
$sel:autoAcceptRequests:BookingOptions' :: BookingOptions -> Maybe Bool
$sel:autoDeclineRecurringRequests:BookingOptions' :: BookingOptions -> Maybe Bool
$sel:autoDeclineConflictingRequests:BookingOptions' :: BookingOptions -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AutoDeclineConflictingRequests" 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
autoDeclineConflictingRequests,
(Text
"AutoDeclineRecurringRequests" 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
autoDeclineRecurringRequests,
(Text
"AutoAcceptRequests" 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
autoAcceptRequests
]
)