{-# 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.Lens as Lens
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
(Account -> Account -> Bool)
-> (Account -> Account -> Bool) -> Eq Account
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]
(Int -> ReadS Account)
-> ReadS [Account]
-> ReadPrec Account
-> ReadPrec [Account]
-> Read 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
(Int -> Account -> ShowS)
-> (Account -> String) -> ([Account] -> ShowS) -> Show Account
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. Account -> Rep Account x)
-> (forall x. Rep Account x -> Account) -> Generic Account
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' :: Maybe Text
-> Maybe Text -> Maybe [Text] -> Maybe ThrottleSettings -> Account
Account'
{ $sel:apiKeyVersion:Account' :: Maybe Text
apiKeyVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cloudwatchRoleArn:Account' :: Maybe Text
cloudwatchRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:features:Account' :: Maybe [Text]
features = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:throttleSettings:Account' :: Maybe ThrottleSettings
throttleSettings = Maybe ThrottleSettings
forall a. Maybe a
Prelude.Nothing
}
account_apiKeyVersion :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_apiKeyVersion :: (Maybe Text -> f (Maybe Text)) -> Account -> f Account
account_apiKeyVersion = (Account -> Maybe Text)
-> (Account -> Maybe Text -> Account)
-> Lens Account Account (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Account -> f Account
account_cloudwatchRoleArn = (Account -> Maybe Text)
-> (Account -> Maybe Text -> Account)
-> Lens Account Account (Maybe Text) (Maybe Text)
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 :: (Maybe [Text] -> f (Maybe [Text])) -> Account -> f Account
account_features = (Account -> Maybe [Text])
-> (Account -> Maybe [Text] -> Account)
-> Lens Account Account (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text])) -> Account -> f Account)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Account
-> f Account
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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 :: (Maybe ThrottleSettings -> f (Maybe ThrottleSettings))
-> Account -> f Account
account_throttleSettings = (Account -> Maybe ThrottleSettings)
-> (Account -> Maybe ThrottleSettings -> Account)
-> Lens
Account Account (Maybe ThrottleSettings) (Maybe 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 Core.FromJSON Account where
parseJSON :: Value -> Parser Account
parseJSON =
String -> (Object -> Parser Account) -> Value -> Parser Account
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Account"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe [Text] -> Maybe ThrottleSettings -> Account
Account'
(Maybe Text
-> Maybe Text -> Maybe [Text] -> Maybe ThrottleSettings -> Account)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [Text] -> Maybe ThrottleSettings -> Account)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"apiKeyVersion")
Parser
(Maybe Text -> Maybe [Text] -> Maybe ThrottleSettings -> Account)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe ThrottleSettings -> Account)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cloudwatchRoleArn")
Parser (Maybe [Text] -> Maybe ThrottleSettings -> Account)
-> Parser (Maybe [Text])
-> Parser (Maybe ThrottleSettings -> Account)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"features" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe ThrottleSettings -> Account)
-> Parser (Maybe ThrottleSettings) -> Parser Account
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ThrottleSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"throttleSettings")
)
instance Prelude.Hashable Account
instance Prelude.NFData Account