{-# 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.UpdateInstantBooking where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpdateInstantBooking = UpdateInstantBooking'
{
UpdateInstantBooking -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
UpdateInstantBooking -> Maybe Int
durationInMinutes :: Prelude.Maybe Prelude.Int
}
deriving (UpdateInstantBooking -> UpdateInstantBooking -> Bool
(UpdateInstantBooking -> UpdateInstantBooking -> Bool)
-> (UpdateInstantBooking -> UpdateInstantBooking -> Bool)
-> Eq UpdateInstantBooking
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
$c/= :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
== :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
$c== :: UpdateInstantBooking -> UpdateInstantBooking -> Bool
Prelude.Eq, ReadPrec [UpdateInstantBooking]
ReadPrec UpdateInstantBooking
Int -> ReadS UpdateInstantBooking
ReadS [UpdateInstantBooking]
(Int -> ReadS UpdateInstantBooking)
-> ReadS [UpdateInstantBooking]
-> ReadPrec UpdateInstantBooking
-> ReadPrec [UpdateInstantBooking]
-> Read UpdateInstantBooking
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateInstantBooking]
$creadListPrec :: ReadPrec [UpdateInstantBooking]
readPrec :: ReadPrec UpdateInstantBooking
$creadPrec :: ReadPrec UpdateInstantBooking
readList :: ReadS [UpdateInstantBooking]
$creadList :: ReadS [UpdateInstantBooking]
readsPrec :: Int -> ReadS UpdateInstantBooking
$creadsPrec :: Int -> ReadS UpdateInstantBooking
Prelude.Read, Int -> UpdateInstantBooking -> ShowS
[UpdateInstantBooking] -> ShowS
UpdateInstantBooking -> String
(Int -> UpdateInstantBooking -> ShowS)
-> (UpdateInstantBooking -> String)
-> ([UpdateInstantBooking] -> ShowS)
-> Show UpdateInstantBooking
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateInstantBooking] -> ShowS
$cshowList :: [UpdateInstantBooking] -> ShowS
show :: UpdateInstantBooking -> String
$cshow :: UpdateInstantBooking -> String
showsPrec :: Int -> UpdateInstantBooking -> ShowS
$cshowsPrec :: Int -> UpdateInstantBooking -> ShowS
Prelude.Show, (forall x. UpdateInstantBooking -> Rep UpdateInstantBooking x)
-> (forall x. Rep UpdateInstantBooking x -> UpdateInstantBooking)
-> Generic UpdateInstantBooking
forall x. Rep UpdateInstantBooking x -> UpdateInstantBooking
forall x. UpdateInstantBooking -> Rep UpdateInstantBooking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateInstantBooking x -> UpdateInstantBooking
$cfrom :: forall x. UpdateInstantBooking -> Rep UpdateInstantBooking x
Prelude.Generic)
newUpdateInstantBooking ::
UpdateInstantBooking
newUpdateInstantBooking :: UpdateInstantBooking
newUpdateInstantBooking =
UpdateInstantBooking' :: Maybe Bool -> Maybe Int -> UpdateInstantBooking
UpdateInstantBooking'
{ $sel:enabled:UpdateInstantBooking' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:durationInMinutes:UpdateInstantBooking' :: Maybe Int
durationInMinutes = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
updateInstantBooking_enabled :: Lens.Lens' UpdateInstantBooking (Prelude.Maybe Prelude.Bool)
updateInstantBooking_enabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateInstantBooking -> f UpdateInstantBooking
updateInstantBooking_enabled = (UpdateInstantBooking -> Maybe Bool)
-> (UpdateInstantBooking -> Maybe Bool -> UpdateInstantBooking)
-> Lens
UpdateInstantBooking UpdateInstantBooking (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstantBooking' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateInstantBooking
s@UpdateInstantBooking' {} Maybe Bool
a -> UpdateInstantBooking
s {$sel:enabled:UpdateInstantBooking' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateInstantBooking)
updateInstantBooking_durationInMinutes :: Lens.Lens' UpdateInstantBooking (Prelude.Maybe Prelude.Int)
updateInstantBooking_durationInMinutes :: (Maybe Int -> f (Maybe Int))
-> UpdateInstantBooking -> f UpdateInstantBooking
updateInstantBooking_durationInMinutes = (UpdateInstantBooking -> Maybe Int)
-> (UpdateInstantBooking -> Maybe Int -> UpdateInstantBooking)
-> Lens
UpdateInstantBooking UpdateInstantBooking (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstantBooking' {Maybe Int
durationInMinutes :: Maybe Int
$sel:durationInMinutes:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Int
durationInMinutes} -> Maybe Int
durationInMinutes) (\s :: UpdateInstantBooking
s@UpdateInstantBooking' {} Maybe Int
a -> UpdateInstantBooking
s {$sel:durationInMinutes:UpdateInstantBooking' :: Maybe Int
durationInMinutes = Maybe Int
a} :: UpdateInstantBooking)
instance Prelude.Hashable UpdateInstantBooking
instance Prelude.NFData UpdateInstantBooking
instance Core.ToJSON UpdateInstantBooking where
toJSON :: UpdateInstantBooking -> Value
toJSON UpdateInstantBooking' {Maybe Bool
Maybe Int
durationInMinutes :: Maybe Int
enabled :: Maybe Bool
$sel:durationInMinutes:UpdateInstantBooking' :: UpdateInstantBooking -> Maybe Int
$sel:enabled:UpdateInstantBooking' :: UpdateInstantBooking -> 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
"DurationInMinutes" 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
durationInMinutes
]
)