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