{-# 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.RedshiftServerLess.Types.UsageLimit 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
import Amazonka.RedshiftServerLess.Types.UsageLimitBreachAction
import Amazonka.RedshiftServerLess.Types.UsageLimitPeriod
import Amazonka.RedshiftServerLess.Types.UsageLimitUsageType
data UsageLimit = UsageLimit'
{
UsageLimit -> Maybe Integer
amount :: Prelude.Maybe Prelude.Integer,
UsageLimit -> Maybe UsageLimitBreachAction
breachAction :: Prelude.Maybe UsageLimitBreachAction,
UsageLimit -> Maybe UsageLimitPeriod
period :: Prelude.Maybe UsageLimitPeriod,
UsageLimit -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
UsageLimit -> Maybe Text
usageLimitArn :: Prelude.Maybe Prelude.Text,
UsageLimit -> Maybe Text
usageLimitId :: Prelude.Maybe Prelude.Text,
UsageLimit -> Maybe UsageLimitUsageType
usageType :: Prelude.Maybe UsageLimitUsageType
}
deriving (UsageLimit -> UsageLimit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UsageLimit -> UsageLimit -> Bool
$c/= :: UsageLimit -> UsageLimit -> Bool
== :: UsageLimit -> UsageLimit -> Bool
$c== :: UsageLimit -> UsageLimit -> Bool
Prelude.Eq, ReadPrec [UsageLimit]
ReadPrec UsageLimit
Int -> ReadS UsageLimit
ReadS [UsageLimit]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UsageLimit]
$creadListPrec :: ReadPrec [UsageLimit]
readPrec :: ReadPrec UsageLimit
$creadPrec :: ReadPrec UsageLimit
readList :: ReadS [UsageLimit]
$creadList :: ReadS [UsageLimit]
readsPrec :: Int -> ReadS UsageLimit
$creadsPrec :: Int -> ReadS UsageLimit
Prelude.Read, Int -> UsageLimit -> ShowS
[UsageLimit] -> ShowS
UsageLimit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UsageLimit] -> ShowS
$cshowList :: [UsageLimit] -> ShowS
show :: UsageLimit -> String
$cshow :: UsageLimit -> String
showsPrec :: Int -> UsageLimit -> ShowS
$cshowsPrec :: Int -> UsageLimit -> ShowS
Prelude.Show, forall x. Rep UsageLimit x -> UsageLimit
forall x. UsageLimit -> Rep UsageLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UsageLimit x -> UsageLimit
$cfrom :: forall x. UsageLimit -> Rep UsageLimit x
Prelude.Generic)
newUsageLimit ::
UsageLimit
newUsageLimit :: UsageLimit
newUsageLimit =
UsageLimit'
{ $sel:amount:UsageLimit' :: Maybe Integer
amount = forall a. Maybe a
Prelude.Nothing,
$sel:breachAction:UsageLimit' :: Maybe UsageLimitBreachAction
breachAction = forall a. Maybe a
Prelude.Nothing,
$sel:period:UsageLimit' :: Maybe UsageLimitPeriod
period = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:UsageLimit' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing,
$sel:usageLimitArn:UsageLimit' :: Maybe Text
usageLimitArn = forall a. Maybe a
Prelude.Nothing,
$sel:usageLimitId:UsageLimit' :: Maybe Text
usageLimitId = forall a. Maybe a
Prelude.Nothing,
$sel:usageType:UsageLimit' :: Maybe UsageLimitUsageType
usageType = forall a. Maybe a
Prelude.Nothing
}
usageLimit_amount :: Lens.Lens' UsageLimit (Prelude.Maybe Prelude.Integer)
usageLimit_amount :: Lens' UsageLimit (Maybe Integer)
usageLimit_amount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe Integer
amount :: Maybe Integer
$sel:amount:UsageLimit' :: UsageLimit -> Maybe Integer
amount} -> Maybe Integer
amount) (\s :: UsageLimit
s@UsageLimit' {} Maybe Integer
a -> UsageLimit
s {$sel:amount:UsageLimit' :: Maybe Integer
amount = Maybe Integer
a} :: UsageLimit)
usageLimit_breachAction :: Lens.Lens' UsageLimit (Prelude.Maybe UsageLimitBreachAction)
usageLimit_breachAction :: Lens' UsageLimit (Maybe UsageLimitBreachAction)
usageLimit_breachAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe UsageLimitBreachAction
breachAction :: Maybe UsageLimitBreachAction
$sel:breachAction:UsageLimit' :: UsageLimit -> Maybe UsageLimitBreachAction
breachAction} -> Maybe UsageLimitBreachAction
breachAction) (\s :: UsageLimit
s@UsageLimit' {} Maybe UsageLimitBreachAction
a -> UsageLimit
s {$sel:breachAction:UsageLimit' :: Maybe UsageLimitBreachAction
breachAction = Maybe UsageLimitBreachAction
a} :: UsageLimit)
usageLimit_period :: Lens.Lens' UsageLimit (Prelude.Maybe UsageLimitPeriod)
usageLimit_period :: Lens' UsageLimit (Maybe UsageLimitPeriod)
usageLimit_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe UsageLimitPeriod
period :: Maybe UsageLimitPeriod
$sel:period:UsageLimit' :: UsageLimit -> Maybe UsageLimitPeriod
period} -> Maybe UsageLimitPeriod
period) (\s :: UsageLimit
s@UsageLimit' {} Maybe UsageLimitPeriod
a -> UsageLimit
s {$sel:period:UsageLimit' :: Maybe UsageLimitPeriod
period = Maybe UsageLimitPeriod
a} :: UsageLimit)
usageLimit_resourceArn :: Lens.Lens' UsageLimit (Prelude.Maybe Prelude.Text)
usageLimit_resourceArn :: Lens' UsageLimit (Maybe Text)
usageLimit_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:UsageLimit' :: UsageLimit -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: UsageLimit
s@UsageLimit' {} Maybe Text
a -> UsageLimit
s {$sel:resourceArn:UsageLimit' :: Maybe Text
resourceArn = Maybe Text
a} :: UsageLimit)
usageLimit_usageLimitArn :: Lens.Lens' UsageLimit (Prelude.Maybe Prelude.Text)
usageLimit_usageLimitArn :: Lens' UsageLimit (Maybe Text)
usageLimit_usageLimitArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe Text
usageLimitArn :: Maybe Text
$sel:usageLimitArn:UsageLimit' :: UsageLimit -> Maybe Text
usageLimitArn} -> Maybe Text
usageLimitArn) (\s :: UsageLimit
s@UsageLimit' {} Maybe Text
a -> UsageLimit
s {$sel:usageLimitArn:UsageLimit' :: Maybe Text
usageLimitArn = Maybe Text
a} :: UsageLimit)
usageLimit_usageLimitId :: Lens.Lens' UsageLimit (Prelude.Maybe Prelude.Text)
usageLimit_usageLimitId :: Lens' UsageLimit (Maybe Text)
usageLimit_usageLimitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe Text
usageLimitId :: Maybe Text
$sel:usageLimitId:UsageLimit' :: UsageLimit -> Maybe Text
usageLimitId} -> Maybe Text
usageLimitId) (\s :: UsageLimit
s@UsageLimit' {} Maybe Text
a -> UsageLimit
s {$sel:usageLimitId:UsageLimit' :: Maybe Text
usageLimitId = Maybe Text
a} :: UsageLimit)
usageLimit_usageType :: Lens.Lens' UsageLimit (Prelude.Maybe UsageLimitUsageType)
usageLimit_usageType :: Lens' UsageLimit (Maybe UsageLimitUsageType)
usageLimit_usageType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UsageLimit' {Maybe UsageLimitUsageType
usageType :: Maybe UsageLimitUsageType
$sel:usageType:UsageLimit' :: UsageLimit -> Maybe UsageLimitUsageType
usageType} -> Maybe UsageLimitUsageType
usageType) (\s :: UsageLimit
s@UsageLimit' {} Maybe UsageLimitUsageType
a -> UsageLimit
s {$sel:usageType:UsageLimit' :: Maybe UsageLimitUsageType
usageType = Maybe UsageLimitUsageType
a} :: UsageLimit)
instance Data.FromJSON UsageLimit where
parseJSON :: Value -> Parser UsageLimit
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UsageLimit"
( \Object
x ->
Maybe Integer
-> Maybe UsageLimitBreachAction
-> Maybe UsageLimitPeriod
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe UsageLimitUsageType
-> UsageLimit
UsageLimit'
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
"amount")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"breachAction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"period")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"usageLimitArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"usageLimitId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"usageType")
)
instance Prelude.Hashable UsageLimit where
hashWithSalt :: Int -> UsageLimit -> Int
hashWithSalt Int
_salt UsageLimit' {Maybe Integer
Maybe Text
Maybe UsageLimitBreachAction
Maybe UsageLimitPeriod
Maybe UsageLimitUsageType
usageType :: Maybe UsageLimitUsageType
usageLimitId :: Maybe Text
usageLimitArn :: Maybe Text
resourceArn :: Maybe Text
period :: Maybe UsageLimitPeriod
breachAction :: Maybe UsageLimitBreachAction
amount :: Maybe Integer
$sel:usageType:UsageLimit' :: UsageLimit -> Maybe UsageLimitUsageType
$sel:usageLimitId:UsageLimit' :: UsageLimit -> Maybe Text
$sel:usageLimitArn:UsageLimit' :: UsageLimit -> Maybe Text
$sel:resourceArn:UsageLimit' :: UsageLimit -> Maybe Text
$sel:period:UsageLimit' :: UsageLimit -> Maybe UsageLimitPeriod
$sel:breachAction:UsageLimit' :: UsageLimit -> Maybe UsageLimitBreachAction
$sel:amount:UsageLimit' :: UsageLimit -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
amount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsageLimitBreachAction
breachAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsageLimitPeriod
period
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
usageLimitArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
usageLimitId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UsageLimitUsageType
usageType
instance Prelude.NFData UsageLimit where
rnf :: UsageLimit -> ()
rnf UsageLimit' {Maybe Integer
Maybe Text
Maybe UsageLimitBreachAction
Maybe UsageLimitPeriod
Maybe UsageLimitUsageType
usageType :: Maybe UsageLimitUsageType
usageLimitId :: Maybe Text
usageLimitArn :: Maybe Text
resourceArn :: Maybe Text
period :: Maybe UsageLimitPeriod
breachAction :: Maybe UsageLimitBreachAction
amount :: Maybe Integer
$sel:usageType:UsageLimit' :: UsageLimit -> Maybe UsageLimitUsageType
$sel:usageLimitId:UsageLimit' :: UsageLimit -> Maybe Text
$sel:usageLimitArn:UsageLimit' :: UsageLimit -> Maybe Text
$sel:resourceArn:UsageLimit' :: UsageLimit -> Maybe Text
$sel:period:UsageLimit' :: UsageLimit -> Maybe UsageLimitPeriod
$sel:breachAction:UsageLimit' :: UsageLimit -> Maybe UsageLimitBreachAction
$sel:amount:UsageLimit' :: UsageLimit -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
amount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageLimitBreachAction
breachAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageLimitPeriod
period
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
usageLimitArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
usageLimitId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageLimitUsageType
usageType