{-# 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.PinpointSmsVoiceV2.Types.AccountLimit where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointSmsVoiceV2.Types.AccountLimitName
import qualified Amazonka.Prelude as Prelude
data AccountLimit = AccountLimit'
{
AccountLimit -> AccountLimitName
name :: AccountLimitName,
AccountLimit -> Integer
used :: Prelude.Integer,
AccountLimit -> Integer
max :: Prelude.Integer
}
deriving (AccountLimit -> AccountLimit -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountLimit -> AccountLimit -> Bool
$c/= :: AccountLimit -> AccountLimit -> Bool
== :: AccountLimit -> AccountLimit -> Bool
$c== :: AccountLimit -> AccountLimit -> Bool
Prelude.Eq, ReadPrec [AccountLimit]
ReadPrec AccountLimit
Int -> ReadS AccountLimit
ReadS [AccountLimit]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountLimit]
$creadListPrec :: ReadPrec [AccountLimit]
readPrec :: ReadPrec AccountLimit
$creadPrec :: ReadPrec AccountLimit
readList :: ReadS [AccountLimit]
$creadList :: ReadS [AccountLimit]
readsPrec :: Int -> ReadS AccountLimit
$creadsPrec :: Int -> ReadS AccountLimit
Prelude.Read, Int -> AccountLimit -> ShowS
[AccountLimit] -> ShowS
AccountLimit -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountLimit] -> ShowS
$cshowList :: [AccountLimit] -> ShowS
show :: AccountLimit -> String
$cshow :: AccountLimit -> String
showsPrec :: Int -> AccountLimit -> ShowS
$cshowsPrec :: Int -> AccountLimit -> ShowS
Prelude.Show, forall x. Rep AccountLimit x -> AccountLimit
forall x. AccountLimit -> Rep AccountLimit x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountLimit x -> AccountLimit
$cfrom :: forall x. AccountLimit -> Rep AccountLimit x
Prelude.Generic)
newAccountLimit ::
AccountLimitName ->
Prelude.Integer ->
Prelude.Integer ->
AccountLimit
newAccountLimit :: AccountLimitName -> Integer -> Integer -> AccountLimit
newAccountLimit AccountLimitName
pName_ Integer
pUsed_ Integer
pMax_ =
AccountLimit'
{ $sel:name:AccountLimit' :: AccountLimitName
name = AccountLimitName
pName_,
$sel:used:AccountLimit' :: Integer
used = Integer
pUsed_,
$sel:max:AccountLimit' :: Integer
max = Integer
pMax_
}
accountLimit_name :: Lens.Lens' AccountLimit AccountLimitName
accountLimit_name :: Lens' AccountLimit AccountLimitName
accountLimit_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountLimit' {AccountLimitName
name :: AccountLimitName
$sel:name:AccountLimit' :: AccountLimit -> AccountLimitName
name} -> AccountLimitName
name) (\s :: AccountLimit
s@AccountLimit' {} AccountLimitName
a -> AccountLimit
s {$sel:name:AccountLimit' :: AccountLimitName
name = AccountLimitName
a} :: AccountLimit)
accountLimit_used :: Lens.Lens' AccountLimit Prelude.Integer
accountLimit_used :: Lens' AccountLimit Integer
accountLimit_used = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountLimit' {Integer
used :: Integer
$sel:used:AccountLimit' :: AccountLimit -> Integer
used} -> Integer
used) (\s :: AccountLimit
s@AccountLimit' {} Integer
a -> AccountLimit
s {$sel:used:AccountLimit' :: Integer
used = Integer
a} :: AccountLimit)
accountLimit_max :: Lens.Lens' AccountLimit Prelude.Integer
accountLimit_max :: Lens' AccountLimit Integer
accountLimit_max = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountLimit' {Integer
max :: Integer
$sel:max:AccountLimit' :: AccountLimit -> Integer
max} -> Integer
max) (\s :: AccountLimit
s@AccountLimit' {} Integer
a -> AccountLimit
s {$sel:max:AccountLimit' :: Integer
max = Integer
a} :: AccountLimit)
instance Data.FromJSON AccountLimit where
parseJSON :: Value -> Parser AccountLimit
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AccountLimit"
( \Object
x ->
AccountLimitName -> Integer -> Integer -> AccountLimit
AccountLimit'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
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
"Used")
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
"Max")
)
instance Prelude.Hashable AccountLimit where
hashWithSalt :: Int -> AccountLimit -> Int
hashWithSalt Int
_salt AccountLimit' {Integer
AccountLimitName
max :: Integer
used :: Integer
name :: AccountLimitName
$sel:max:AccountLimit' :: AccountLimit -> Integer
$sel:used:AccountLimit' :: AccountLimit -> Integer
$sel:name:AccountLimit' :: AccountLimit -> AccountLimitName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AccountLimitName
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
used
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
max
instance Prelude.NFData AccountLimit where
rnf :: AccountLimit -> ()
rnf AccountLimit' {Integer
AccountLimitName
max :: Integer
used :: Integer
name :: AccountLimitName
$sel:max:AccountLimit' :: AccountLimit -> Integer
$sel:used:AccountLimit' :: AccountLimit -> Integer
$sel:name:AccountLimit' :: AccountLimit -> AccountLimitName
..} =
forall a. NFData a => a -> ()
Prelude.rnf AccountLimitName
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
used
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
max