{-# 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.Connect.Types.HoursOfOperationTimeSlice where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HoursOfOperationTimeSlice = HoursOfOperationTimeSlice'
{
HoursOfOperationTimeSlice -> Natural
hours :: Prelude.Natural,
HoursOfOperationTimeSlice -> Natural
minutes :: Prelude.Natural
}
deriving (HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool
(HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool)
-> (HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool)
-> Eq HoursOfOperationTimeSlice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool
$c/= :: HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool
== :: HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool
$c== :: HoursOfOperationTimeSlice -> HoursOfOperationTimeSlice -> Bool
Prelude.Eq, ReadPrec [HoursOfOperationTimeSlice]
ReadPrec HoursOfOperationTimeSlice
Int -> ReadS HoursOfOperationTimeSlice
ReadS [HoursOfOperationTimeSlice]
(Int -> ReadS HoursOfOperationTimeSlice)
-> ReadS [HoursOfOperationTimeSlice]
-> ReadPrec HoursOfOperationTimeSlice
-> ReadPrec [HoursOfOperationTimeSlice]
-> Read HoursOfOperationTimeSlice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HoursOfOperationTimeSlice]
$creadListPrec :: ReadPrec [HoursOfOperationTimeSlice]
readPrec :: ReadPrec HoursOfOperationTimeSlice
$creadPrec :: ReadPrec HoursOfOperationTimeSlice
readList :: ReadS [HoursOfOperationTimeSlice]
$creadList :: ReadS [HoursOfOperationTimeSlice]
readsPrec :: Int -> ReadS HoursOfOperationTimeSlice
$creadsPrec :: Int -> ReadS HoursOfOperationTimeSlice
Prelude.Read, Int -> HoursOfOperationTimeSlice -> ShowS
[HoursOfOperationTimeSlice] -> ShowS
HoursOfOperationTimeSlice -> String
(Int -> HoursOfOperationTimeSlice -> ShowS)
-> (HoursOfOperationTimeSlice -> String)
-> ([HoursOfOperationTimeSlice] -> ShowS)
-> Show HoursOfOperationTimeSlice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HoursOfOperationTimeSlice] -> ShowS
$cshowList :: [HoursOfOperationTimeSlice] -> ShowS
show :: HoursOfOperationTimeSlice -> String
$cshow :: HoursOfOperationTimeSlice -> String
showsPrec :: Int -> HoursOfOperationTimeSlice -> ShowS
$cshowsPrec :: Int -> HoursOfOperationTimeSlice -> ShowS
Prelude.Show, (forall x.
HoursOfOperationTimeSlice -> Rep HoursOfOperationTimeSlice x)
-> (forall x.
Rep HoursOfOperationTimeSlice x -> HoursOfOperationTimeSlice)
-> Generic HoursOfOperationTimeSlice
forall x.
Rep HoursOfOperationTimeSlice x -> HoursOfOperationTimeSlice
forall x.
HoursOfOperationTimeSlice -> Rep HoursOfOperationTimeSlice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HoursOfOperationTimeSlice x -> HoursOfOperationTimeSlice
$cfrom :: forall x.
HoursOfOperationTimeSlice -> Rep HoursOfOperationTimeSlice x
Prelude.Generic)
newHoursOfOperationTimeSlice ::
Prelude.Natural ->
Prelude.Natural ->
HoursOfOperationTimeSlice
newHoursOfOperationTimeSlice :: Natural -> Natural -> HoursOfOperationTimeSlice
newHoursOfOperationTimeSlice Natural
pHours_ Natural
pMinutes_ =
HoursOfOperationTimeSlice' :: Natural -> Natural -> HoursOfOperationTimeSlice
HoursOfOperationTimeSlice'
{ $sel:hours:HoursOfOperationTimeSlice' :: Natural
hours = Natural
pHours_,
$sel:minutes:HoursOfOperationTimeSlice' :: Natural
minutes = Natural
pMinutes_
}
hoursOfOperationTimeSlice_hours :: Lens.Lens' HoursOfOperationTimeSlice Prelude.Natural
hoursOfOperationTimeSlice_hours :: (Natural -> f Natural)
-> HoursOfOperationTimeSlice -> f HoursOfOperationTimeSlice
hoursOfOperationTimeSlice_hours = (HoursOfOperationTimeSlice -> Natural)
-> (HoursOfOperationTimeSlice
-> Natural -> HoursOfOperationTimeSlice)
-> Lens
HoursOfOperationTimeSlice HoursOfOperationTimeSlice Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoursOfOperationTimeSlice' {Natural
hours :: Natural
$sel:hours:HoursOfOperationTimeSlice' :: HoursOfOperationTimeSlice -> Natural
hours} -> Natural
hours) (\s :: HoursOfOperationTimeSlice
s@HoursOfOperationTimeSlice' {} Natural
a -> HoursOfOperationTimeSlice
s {$sel:hours:HoursOfOperationTimeSlice' :: Natural
hours = Natural
a} :: HoursOfOperationTimeSlice)
hoursOfOperationTimeSlice_minutes :: Lens.Lens' HoursOfOperationTimeSlice Prelude.Natural
hoursOfOperationTimeSlice_minutes :: (Natural -> f Natural)
-> HoursOfOperationTimeSlice -> f HoursOfOperationTimeSlice
hoursOfOperationTimeSlice_minutes = (HoursOfOperationTimeSlice -> Natural)
-> (HoursOfOperationTimeSlice
-> Natural -> HoursOfOperationTimeSlice)
-> Lens
HoursOfOperationTimeSlice HoursOfOperationTimeSlice Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoursOfOperationTimeSlice' {Natural
minutes :: Natural
$sel:minutes:HoursOfOperationTimeSlice' :: HoursOfOperationTimeSlice -> Natural
minutes} -> Natural
minutes) (\s :: HoursOfOperationTimeSlice
s@HoursOfOperationTimeSlice' {} Natural
a -> HoursOfOperationTimeSlice
s {$sel:minutes:HoursOfOperationTimeSlice' :: Natural
minutes = Natural
a} :: HoursOfOperationTimeSlice)
instance Core.FromJSON HoursOfOperationTimeSlice where
parseJSON :: Value -> Parser HoursOfOperationTimeSlice
parseJSON =
String
-> (Object -> Parser HoursOfOperationTimeSlice)
-> Value
-> Parser HoursOfOperationTimeSlice
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HoursOfOperationTimeSlice"
( \Object
x ->
Natural -> Natural -> HoursOfOperationTimeSlice
HoursOfOperationTimeSlice'
(Natural -> Natural -> HoursOfOperationTimeSlice)
-> Parser Natural -> Parser (Natural -> HoursOfOperationTimeSlice)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Hours")
Parser (Natural -> HoursOfOperationTimeSlice)
-> Parser Natural -> Parser HoursOfOperationTimeSlice
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Minutes")
)
instance Prelude.Hashable HoursOfOperationTimeSlice
instance Prelude.NFData HoursOfOperationTimeSlice
instance Core.ToJSON HoursOfOperationTimeSlice where
toJSON :: HoursOfOperationTimeSlice -> Value
toJSON HoursOfOperationTimeSlice' {Natural
minutes :: Natural
hours :: Natural
$sel:minutes:HoursOfOperationTimeSlice' :: HoursOfOperationTimeSlice -> Natural
$sel:hours:HoursOfOperationTimeSlice' :: HoursOfOperationTimeSlice -> Natural
..} =
[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
"Hours" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
hours),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Minutes" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
minutes)
]
)