{-# 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.APIGateway.Types.Account where
import Amazonka.APIGateway.Types.ThrottleSettings
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 Account = Account'
{
Account -> Maybe Text
apiKeyVersion :: Prelude.Maybe Prelude.Text,
Account -> Maybe Text
cloudwatchRoleArn :: Prelude.Maybe Prelude.Text,
Account -> Maybe [Text]
features :: Prelude.Maybe [Prelude.Text],
Account -> Maybe ThrottleSettings
throttleSettings :: Prelude.Maybe ThrottleSettings
}
deriving (Account -> Account -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Account -> Account -> Bool
$c/= :: Account -> Account -> Bool
== :: Account -> Account -> Bool
$c== :: Account -> Account -> Bool
Prelude.Eq, ReadPrec [Account]
ReadPrec Account
Int -> ReadS Account
ReadS [Account]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Account]
$creadListPrec :: ReadPrec [Account]
readPrec :: ReadPrec Account
$creadPrec :: ReadPrec Account
readList :: ReadS [Account]
$creadList :: ReadS [Account]
readsPrec :: Int -> ReadS Account
$creadsPrec :: Int -> ReadS Account
Prelude.Read, Int -> Account -> ShowS
[Account] -> ShowS
Account -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Account] -> ShowS
$cshowList :: [Account] -> ShowS
show :: Account -> String
$cshow :: Account -> String
showsPrec :: Int -> Account -> ShowS
$cshowsPrec :: Int -> Account -> ShowS
Prelude.Show, forall x. Rep Account x -> Account
forall x. Account -> Rep Account x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Account x -> Account
$cfrom :: forall x. Account -> Rep Account x
Prelude.Generic)
newAccount ::
Account
newAccount :: Account
newAccount =
Account'
{ $sel:apiKeyVersion:Account' :: Maybe Text
apiKeyVersion = forall a. Maybe a
Prelude.Nothing,
$sel:cloudwatchRoleArn:Account' :: Maybe Text
cloudwatchRoleArn = forall a. Maybe a
Prelude.Nothing,
$sel:features:Account' :: Maybe [Text]
features = forall a. Maybe a
Prelude.Nothing,
$sel:throttleSettings:Account' :: Maybe ThrottleSettings
throttleSettings = forall a. Maybe a
Prelude.Nothing
}
account_apiKeyVersion :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_apiKeyVersion :: Lens' Account (Maybe Text)
account_apiKeyVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe Text
apiKeyVersion :: Maybe Text
$sel:apiKeyVersion:Account' :: Account -> Maybe Text
apiKeyVersion} -> Maybe Text
apiKeyVersion) (\s :: Account
s@Account' {} Maybe Text
a -> Account
s {$sel:apiKeyVersion:Account' :: Maybe Text
apiKeyVersion = Maybe Text
a} :: Account)
account_cloudwatchRoleArn :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_cloudwatchRoleArn :: Lens' Account (Maybe Text)
account_cloudwatchRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe Text
cloudwatchRoleArn :: Maybe Text
$sel:cloudwatchRoleArn:Account' :: Account -> Maybe Text
cloudwatchRoleArn} -> Maybe Text
cloudwatchRoleArn) (\s :: Account
s@Account' {} Maybe Text
a -> Account
s {$sel:cloudwatchRoleArn:Account' :: Maybe Text
cloudwatchRoleArn = Maybe Text
a} :: Account)
account_features :: Lens.Lens' Account (Prelude.Maybe [Prelude.Text])
account_features :: Lens' Account (Maybe [Text])
account_features = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe [Text]
features :: Maybe [Text]
$sel:features:Account' :: Account -> Maybe [Text]
features} -> Maybe [Text]
features) (\s :: Account
s@Account' {} Maybe [Text]
a -> Account
s {$sel:features:Account' :: Maybe [Text]
features = Maybe [Text]
a} :: Account) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
account_throttleSettings :: Lens.Lens' Account (Prelude.Maybe ThrottleSettings)
account_throttleSettings :: Lens' Account (Maybe ThrottleSettings)
account_throttleSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe ThrottleSettings
throttleSettings :: Maybe ThrottleSettings
$sel:throttleSettings:Account' :: Account -> Maybe ThrottleSettings
throttleSettings} -> Maybe ThrottleSettings
throttleSettings) (\s :: Account
s@Account' {} Maybe ThrottleSettings
a -> Account
s {$sel:throttleSettings:Account' :: Maybe ThrottleSettings
throttleSettings = Maybe ThrottleSettings
a} :: Account)
instance Data.FromJSON Account where
parseJSON :: Value -> Parser Account
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Account"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe [Text] -> Maybe ThrottleSettings -> Account
Account'
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
"apiKeyVersion")
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
"cloudwatchRoleArn")
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
"features" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"throttleSettings")
)
instance Prelude.Hashable Account where
hashWithSalt :: Int -> Account -> Int
hashWithSalt Int
_salt Account' {Maybe [Text]
Maybe Text
Maybe ThrottleSettings
throttleSettings :: Maybe ThrottleSettings
features :: Maybe [Text]
cloudwatchRoleArn :: Maybe Text
apiKeyVersion :: Maybe Text
$sel:throttleSettings:Account' :: Account -> Maybe ThrottleSettings
$sel:features:Account' :: Account -> Maybe [Text]
$sel:cloudwatchRoleArn:Account' :: Account -> Maybe Text
$sel:apiKeyVersion:Account' :: Account -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
apiKeyVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cloudwatchRoleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
features
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ThrottleSettings
throttleSettings
instance Prelude.NFData Account where
rnf :: Account -> ()
rnf Account' {Maybe [Text]
Maybe Text
Maybe ThrottleSettings
throttleSettings :: Maybe ThrottleSettings
features :: Maybe [Text]
cloudwatchRoleArn :: Maybe Text
apiKeyVersion :: Maybe Text
$sel:throttleSettings:Account' :: Account -> Maybe ThrottleSettings
$sel:features:Account' :: Account -> Maybe [Text]
$sel:cloudwatchRoleArn:Account' :: Account -> Maybe Text
$sel:apiKeyVersion:Account' :: Account -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiKeyVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cloudwatchRoleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
features
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ThrottleSettings
throttleSettings