{-# 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.BackupGateway.Types.BandwidthRateLimitInterval where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BandwidthRateLimitInterval = BandwidthRateLimitInterval'
{
BandwidthRateLimitInterval -> Maybe Natural
averageUploadRateLimitInBitsPerSec :: Prelude.Maybe Prelude.Natural,
BandwidthRateLimitInterval -> NonEmpty Natural
daysOfWeek :: Prelude.NonEmpty Prelude.Natural,
BandwidthRateLimitInterval -> Natural
endHourOfDay :: Prelude.Natural,
BandwidthRateLimitInterval -> Natural
endMinuteOfHour :: Prelude.Natural,
BandwidthRateLimitInterval -> Natural
startHourOfDay :: Prelude.Natural,
BandwidthRateLimitInterval -> Natural
startMinuteOfHour :: Prelude.Natural
}
deriving (BandwidthRateLimitInterval -> BandwidthRateLimitInterval -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BandwidthRateLimitInterval -> BandwidthRateLimitInterval -> Bool
$c/= :: BandwidthRateLimitInterval -> BandwidthRateLimitInterval -> Bool
== :: BandwidthRateLimitInterval -> BandwidthRateLimitInterval -> Bool
$c== :: BandwidthRateLimitInterval -> BandwidthRateLimitInterval -> Bool
Prelude.Eq, ReadPrec [BandwidthRateLimitInterval]
ReadPrec BandwidthRateLimitInterval
Int -> ReadS BandwidthRateLimitInterval
ReadS [BandwidthRateLimitInterval]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BandwidthRateLimitInterval]
$creadListPrec :: ReadPrec [BandwidthRateLimitInterval]
readPrec :: ReadPrec BandwidthRateLimitInterval
$creadPrec :: ReadPrec BandwidthRateLimitInterval
readList :: ReadS [BandwidthRateLimitInterval]
$creadList :: ReadS [BandwidthRateLimitInterval]
readsPrec :: Int -> ReadS BandwidthRateLimitInterval
$creadsPrec :: Int -> ReadS BandwidthRateLimitInterval
Prelude.Read, Int -> BandwidthRateLimitInterval -> ShowS
[BandwidthRateLimitInterval] -> ShowS
BandwidthRateLimitInterval -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BandwidthRateLimitInterval] -> ShowS
$cshowList :: [BandwidthRateLimitInterval] -> ShowS
show :: BandwidthRateLimitInterval -> String
$cshow :: BandwidthRateLimitInterval -> String
showsPrec :: Int -> BandwidthRateLimitInterval -> ShowS
$cshowsPrec :: Int -> BandwidthRateLimitInterval -> ShowS
Prelude.Show, forall x.
Rep BandwidthRateLimitInterval x -> BandwidthRateLimitInterval
forall x.
BandwidthRateLimitInterval -> Rep BandwidthRateLimitInterval x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BandwidthRateLimitInterval x -> BandwidthRateLimitInterval
$cfrom :: forall x.
BandwidthRateLimitInterval -> Rep BandwidthRateLimitInterval x
Prelude.Generic)
newBandwidthRateLimitInterval ::
Prelude.NonEmpty Prelude.Natural ->
Prelude.Natural ->
Prelude.Natural ->
Prelude.Natural ->
Prelude.Natural ->
BandwidthRateLimitInterval
newBandwidthRateLimitInterval :: NonEmpty Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> BandwidthRateLimitInterval
newBandwidthRateLimitInterval
NonEmpty Natural
pDaysOfWeek_
Natural
pEndHourOfDay_
Natural
pEndMinuteOfHour_
Natural
pStartHourOfDay_
Natural
pStartMinuteOfHour_ =
BandwidthRateLimitInterval'
{ $sel:averageUploadRateLimitInBitsPerSec:BandwidthRateLimitInterval' :: Maybe Natural
averageUploadRateLimitInBitsPerSec =
forall a. Maybe a
Prelude.Nothing,
$sel:daysOfWeek:BandwidthRateLimitInterval' :: NonEmpty Natural
daysOfWeek = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Natural
pDaysOfWeek_,
$sel:endHourOfDay:BandwidthRateLimitInterval' :: Natural
endHourOfDay = Natural
pEndHourOfDay_,
$sel:endMinuteOfHour:BandwidthRateLimitInterval' :: Natural
endMinuteOfHour = Natural
pEndMinuteOfHour_,
$sel:startHourOfDay:BandwidthRateLimitInterval' :: Natural
startHourOfDay = Natural
pStartHourOfDay_,
$sel:startMinuteOfHour:BandwidthRateLimitInterval' :: Natural
startMinuteOfHour = Natural
pStartMinuteOfHour_
}
bandwidthRateLimitInterval_averageUploadRateLimitInBitsPerSec :: Lens.Lens' BandwidthRateLimitInterval (Prelude.Maybe Prelude.Natural)
bandwidthRateLimitInterval_averageUploadRateLimitInBitsPerSec :: Lens' BandwidthRateLimitInterval (Maybe Natural)
bandwidthRateLimitInterval_averageUploadRateLimitInBitsPerSec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BandwidthRateLimitInterval' {Maybe Natural
averageUploadRateLimitInBitsPerSec :: Maybe Natural
$sel:averageUploadRateLimitInBitsPerSec:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Maybe Natural
averageUploadRateLimitInBitsPerSec} -> Maybe Natural
averageUploadRateLimitInBitsPerSec) (\s :: BandwidthRateLimitInterval
s@BandwidthRateLimitInterval' {} Maybe Natural
a -> BandwidthRateLimitInterval
s {$sel:averageUploadRateLimitInBitsPerSec:BandwidthRateLimitInterval' :: Maybe Natural
averageUploadRateLimitInBitsPerSec = Maybe Natural
a} :: BandwidthRateLimitInterval)
bandwidthRateLimitInterval_daysOfWeek :: Lens.Lens' BandwidthRateLimitInterval (Prelude.NonEmpty Prelude.Natural)
bandwidthRateLimitInterval_daysOfWeek :: Lens' BandwidthRateLimitInterval (NonEmpty Natural)
bandwidthRateLimitInterval_daysOfWeek = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BandwidthRateLimitInterval' {NonEmpty Natural
daysOfWeek :: NonEmpty Natural
$sel:daysOfWeek:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> NonEmpty Natural
daysOfWeek} -> NonEmpty Natural
daysOfWeek) (\s :: BandwidthRateLimitInterval
s@BandwidthRateLimitInterval' {} NonEmpty Natural
a -> BandwidthRateLimitInterval
s {$sel:daysOfWeek:BandwidthRateLimitInterval' :: NonEmpty Natural
daysOfWeek = NonEmpty Natural
a} :: BandwidthRateLimitInterval) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
bandwidthRateLimitInterval_endHourOfDay :: Lens.Lens' BandwidthRateLimitInterval Prelude.Natural
bandwidthRateLimitInterval_endHourOfDay :: Lens' BandwidthRateLimitInterval Natural
bandwidthRateLimitInterval_endHourOfDay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BandwidthRateLimitInterval' {Natural
endHourOfDay :: Natural
$sel:endHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
endHourOfDay} -> Natural
endHourOfDay) (\s :: BandwidthRateLimitInterval
s@BandwidthRateLimitInterval' {} Natural
a -> BandwidthRateLimitInterval
s {$sel:endHourOfDay:BandwidthRateLimitInterval' :: Natural
endHourOfDay = Natural
a} :: BandwidthRateLimitInterval)
bandwidthRateLimitInterval_endMinuteOfHour :: Lens.Lens' BandwidthRateLimitInterval Prelude.Natural
bandwidthRateLimitInterval_endMinuteOfHour :: Lens' BandwidthRateLimitInterval Natural
bandwidthRateLimitInterval_endMinuteOfHour = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BandwidthRateLimitInterval' {Natural
endMinuteOfHour :: Natural
$sel:endMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
endMinuteOfHour} -> Natural
endMinuteOfHour) (\s :: BandwidthRateLimitInterval
s@BandwidthRateLimitInterval' {} Natural
a -> BandwidthRateLimitInterval
s {$sel:endMinuteOfHour:BandwidthRateLimitInterval' :: Natural
endMinuteOfHour = Natural
a} :: BandwidthRateLimitInterval)
bandwidthRateLimitInterval_startHourOfDay :: Lens.Lens' BandwidthRateLimitInterval Prelude.Natural
bandwidthRateLimitInterval_startHourOfDay :: Lens' BandwidthRateLimitInterval Natural
bandwidthRateLimitInterval_startHourOfDay = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BandwidthRateLimitInterval' {Natural
startHourOfDay :: Natural
$sel:startHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
startHourOfDay} -> Natural
startHourOfDay) (\s :: BandwidthRateLimitInterval
s@BandwidthRateLimitInterval' {} Natural
a -> BandwidthRateLimitInterval
s {$sel:startHourOfDay:BandwidthRateLimitInterval' :: Natural
startHourOfDay = Natural
a} :: BandwidthRateLimitInterval)
bandwidthRateLimitInterval_startMinuteOfHour :: Lens.Lens' BandwidthRateLimitInterval Prelude.Natural
bandwidthRateLimitInterval_startMinuteOfHour :: Lens' BandwidthRateLimitInterval Natural
bandwidthRateLimitInterval_startMinuteOfHour = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BandwidthRateLimitInterval' {Natural
startMinuteOfHour :: Natural
$sel:startMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
startMinuteOfHour} -> Natural
startMinuteOfHour) (\s :: BandwidthRateLimitInterval
s@BandwidthRateLimitInterval' {} Natural
a -> BandwidthRateLimitInterval
s {$sel:startMinuteOfHour:BandwidthRateLimitInterval' :: Natural
startMinuteOfHour = Natural
a} :: BandwidthRateLimitInterval)
instance Data.FromJSON BandwidthRateLimitInterval where
parseJSON :: Value -> Parser BandwidthRateLimitInterval
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BandwidthRateLimitInterval"
( \Object
x ->
Maybe Natural
-> NonEmpty Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> BandwidthRateLimitInterval
BandwidthRateLimitInterval'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AverageUploadRateLimitInBitsPerSec")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DaysOfWeek")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EndHourOfDay")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"EndMinuteOfHour")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StartHourOfDay")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StartMinuteOfHour")
)
instance Prelude.Hashable BandwidthRateLimitInterval where
hashWithSalt :: Int -> BandwidthRateLimitInterval -> Int
hashWithSalt Int
_salt BandwidthRateLimitInterval' {Natural
Maybe Natural
NonEmpty Natural
startMinuteOfHour :: Natural
startHourOfDay :: Natural
endMinuteOfHour :: Natural
endHourOfDay :: Natural
daysOfWeek :: NonEmpty Natural
averageUploadRateLimitInBitsPerSec :: Maybe Natural
$sel:startMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:startHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:endMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:endHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:daysOfWeek:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> NonEmpty Natural
$sel:averageUploadRateLimitInBitsPerSec:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
averageUploadRateLimitInBitsPerSec
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Natural
daysOfWeek
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
endHourOfDay
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
endMinuteOfHour
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
startHourOfDay
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
startMinuteOfHour
instance Prelude.NFData BandwidthRateLimitInterval where
rnf :: BandwidthRateLimitInterval -> ()
rnf BandwidthRateLimitInterval' {Natural
Maybe Natural
NonEmpty Natural
startMinuteOfHour :: Natural
startHourOfDay :: Natural
endMinuteOfHour :: Natural
endHourOfDay :: Natural
daysOfWeek :: NonEmpty Natural
averageUploadRateLimitInBitsPerSec :: Maybe Natural
$sel:startMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:startHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:endMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:endHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:daysOfWeek:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> NonEmpty Natural
$sel:averageUploadRateLimitInBitsPerSec:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
averageUploadRateLimitInBitsPerSec
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Natural
daysOfWeek
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
endHourOfDay
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
endMinuteOfHour
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
startHourOfDay
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
startMinuteOfHour
instance Data.ToJSON BandwidthRateLimitInterval where
toJSON :: BandwidthRateLimitInterval -> Value
toJSON BandwidthRateLimitInterval' {Natural
Maybe Natural
NonEmpty Natural
startMinuteOfHour :: Natural
startHourOfDay :: Natural
endMinuteOfHour :: Natural
endHourOfDay :: Natural
daysOfWeek :: NonEmpty Natural
averageUploadRateLimitInBitsPerSec :: Maybe Natural
$sel:startMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:startHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:endMinuteOfHour:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:endHourOfDay:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Natural
$sel:daysOfWeek:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> NonEmpty Natural
$sel:averageUploadRateLimitInBitsPerSec:BandwidthRateLimitInterval' :: BandwidthRateLimitInterval -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AverageUploadRateLimitInBitsPerSec" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
averageUploadRateLimitInBitsPerSec,
forall a. a -> Maybe a
Prelude.Just (Key
"DaysOfWeek" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Natural
daysOfWeek),
forall a. a -> Maybe a
Prelude.Just (Key
"EndHourOfDay" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
endHourOfDay),
forall a. a -> Maybe a
Prelude.Just
(Key
"EndMinuteOfHour" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
endMinuteOfHour),
forall a. a -> Maybe a
Prelude.Just
(Key
"StartHourOfDay" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
startHourOfDay),
forall a. a -> Maybe a
Prelude.Just
(Key
"StartMinuteOfHour" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
startMinuteOfHour)
]
)