{-# 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.ApiGatewayV2.Types.RouteSettings where
import Amazonka.ApiGatewayV2.Types.LoggingLevel
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 RouteSettings = RouteSettings'
{
RouteSettings -> Maybe Bool
dataTraceEnabled :: Prelude.Maybe Prelude.Bool,
RouteSettings -> Maybe Bool
detailedMetricsEnabled :: Prelude.Maybe Prelude.Bool,
RouteSettings -> Maybe LoggingLevel
loggingLevel :: Prelude.Maybe LoggingLevel,
RouteSettings -> Maybe Int
throttlingBurstLimit :: Prelude.Maybe Prelude.Int,
RouteSettings -> Maybe Double
throttlingRateLimit :: Prelude.Maybe Prelude.Double
}
deriving (RouteSettings -> RouteSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RouteSettings -> RouteSettings -> Bool
$c/= :: RouteSettings -> RouteSettings -> Bool
== :: RouteSettings -> RouteSettings -> Bool
$c== :: RouteSettings -> RouteSettings -> Bool
Prelude.Eq, ReadPrec [RouteSettings]
ReadPrec RouteSettings
Int -> ReadS RouteSettings
ReadS [RouteSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RouteSettings]
$creadListPrec :: ReadPrec [RouteSettings]
readPrec :: ReadPrec RouteSettings
$creadPrec :: ReadPrec RouteSettings
readList :: ReadS [RouteSettings]
$creadList :: ReadS [RouteSettings]
readsPrec :: Int -> ReadS RouteSettings
$creadsPrec :: Int -> ReadS RouteSettings
Prelude.Read, Int -> RouteSettings -> ShowS
[RouteSettings] -> ShowS
RouteSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RouteSettings] -> ShowS
$cshowList :: [RouteSettings] -> ShowS
show :: RouteSettings -> String
$cshow :: RouteSettings -> String
showsPrec :: Int -> RouteSettings -> ShowS
$cshowsPrec :: Int -> RouteSettings -> ShowS
Prelude.Show, forall x. Rep RouteSettings x -> RouteSettings
forall x. RouteSettings -> Rep RouteSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RouteSettings x -> RouteSettings
$cfrom :: forall x. RouteSettings -> Rep RouteSettings x
Prelude.Generic)
newRouteSettings ::
RouteSettings
newRouteSettings :: RouteSettings
newRouteSettings =
RouteSettings'
{ $sel:dataTraceEnabled:RouteSettings' :: Maybe Bool
dataTraceEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:detailedMetricsEnabled:RouteSettings' :: Maybe Bool
detailedMetricsEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:loggingLevel:RouteSettings' :: Maybe LoggingLevel
loggingLevel = forall a. Maybe a
Prelude.Nothing,
$sel:throttlingBurstLimit:RouteSettings' :: Maybe Int
throttlingBurstLimit = forall a. Maybe a
Prelude.Nothing,
$sel:throttlingRateLimit:RouteSettings' :: Maybe Double
throttlingRateLimit = forall a. Maybe a
Prelude.Nothing
}
routeSettings_dataTraceEnabled :: Lens.Lens' RouteSettings (Prelude.Maybe Prelude.Bool)
routeSettings_dataTraceEnabled :: Lens' RouteSettings (Maybe Bool)
routeSettings_dataTraceEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteSettings' {Maybe Bool
dataTraceEnabled :: Maybe Bool
$sel:dataTraceEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
dataTraceEnabled} -> Maybe Bool
dataTraceEnabled) (\s :: RouteSettings
s@RouteSettings' {} Maybe Bool
a -> RouteSettings
s {$sel:dataTraceEnabled:RouteSettings' :: Maybe Bool
dataTraceEnabled = Maybe Bool
a} :: RouteSettings)
routeSettings_detailedMetricsEnabled :: Lens.Lens' RouteSettings (Prelude.Maybe Prelude.Bool)
routeSettings_detailedMetricsEnabled :: Lens' RouteSettings (Maybe Bool)
routeSettings_detailedMetricsEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteSettings' {Maybe Bool
detailedMetricsEnabled :: Maybe Bool
$sel:detailedMetricsEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
detailedMetricsEnabled} -> Maybe Bool
detailedMetricsEnabled) (\s :: RouteSettings
s@RouteSettings' {} Maybe Bool
a -> RouteSettings
s {$sel:detailedMetricsEnabled:RouteSettings' :: Maybe Bool
detailedMetricsEnabled = Maybe Bool
a} :: RouteSettings)
routeSettings_loggingLevel :: Lens.Lens' RouteSettings (Prelude.Maybe LoggingLevel)
routeSettings_loggingLevel :: Lens' RouteSettings (Maybe LoggingLevel)
routeSettings_loggingLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteSettings' {Maybe LoggingLevel
loggingLevel :: Maybe LoggingLevel
$sel:loggingLevel:RouteSettings' :: RouteSettings -> Maybe LoggingLevel
loggingLevel} -> Maybe LoggingLevel
loggingLevel) (\s :: RouteSettings
s@RouteSettings' {} Maybe LoggingLevel
a -> RouteSettings
s {$sel:loggingLevel:RouteSettings' :: Maybe LoggingLevel
loggingLevel = Maybe LoggingLevel
a} :: RouteSettings)
routeSettings_throttlingBurstLimit :: Lens.Lens' RouteSettings (Prelude.Maybe Prelude.Int)
routeSettings_throttlingBurstLimit :: Lens' RouteSettings (Maybe Int)
routeSettings_throttlingBurstLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteSettings' {Maybe Int
throttlingBurstLimit :: Maybe Int
$sel:throttlingBurstLimit:RouteSettings' :: RouteSettings -> Maybe Int
throttlingBurstLimit} -> Maybe Int
throttlingBurstLimit) (\s :: RouteSettings
s@RouteSettings' {} Maybe Int
a -> RouteSettings
s {$sel:throttlingBurstLimit:RouteSettings' :: Maybe Int
throttlingBurstLimit = Maybe Int
a} :: RouteSettings)
routeSettings_throttlingRateLimit :: Lens.Lens' RouteSettings (Prelude.Maybe Prelude.Double)
routeSettings_throttlingRateLimit :: Lens' RouteSettings (Maybe Double)
routeSettings_throttlingRateLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RouteSettings' {Maybe Double
throttlingRateLimit :: Maybe Double
$sel:throttlingRateLimit:RouteSettings' :: RouteSettings -> Maybe Double
throttlingRateLimit} -> Maybe Double
throttlingRateLimit) (\s :: RouteSettings
s@RouteSettings' {} Maybe Double
a -> RouteSettings
s {$sel:throttlingRateLimit:RouteSettings' :: Maybe Double
throttlingRateLimit = Maybe Double
a} :: RouteSettings)
instance Data.FromJSON RouteSettings where
parseJSON :: Value -> Parser RouteSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RouteSettings"
( \Object
x ->
Maybe Bool
-> Maybe Bool
-> Maybe LoggingLevel
-> Maybe Int
-> Maybe Double
-> RouteSettings
RouteSettings'
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
"dataTraceEnabled")
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
"detailedMetricsEnabled")
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
"loggingLevel")
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
"throttlingBurstLimit")
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
"throttlingRateLimit")
)
instance Prelude.Hashable RouteSettings where
hashWithSalt :: Int -> RouteSettings -> Int
hashWithSalt Int
_salt RouteSettings' {Maybe Bool
Maybe Double
Maybe Int
Maybe LoggingLevel
throttlingRateLimit :: Maybe Double
throttlingBurstLimit :: Maybe Int
loggingLevel :: Maybe LoggingLevel
detailedMetricsEnabled :: Maybe Bool
dataTraceEnabled :: Maybe Bool
$sel:throttlingRateLimit:RouteSettings' :: RouteSettings -> Maybe Double
$sel:throttlingBurstLimit:RouteSettings' :: RouteSettings -> Maybe Int
$sel:loggingLevel:RouteSettings' :: RouteSettings -> Maybe LoggingLevel
$sel:detailedMetricsEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
$sel:dataTraceEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dataTraceEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
detailedMetricsEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoggingLevel
loggingLevel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
throttlingBurstLimit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
throttlingRateLimit
instance Prelude.NFData RouteSettings where
rnf :: RouteSettings -> ()
rnf RouteSettings' {Maybe Bool
Maybe Double
Maybe Int
Maybe LoggingLevel
throttlingRateLimit :: Maybe Double
throttlingBurstLimit :: Maybe Int
loggingLevel :: Maybe LoggingLevel
detailedMetricsEnabled :: Maybe Bool
dataTraceEnabled :: Maybe Bool
$sel:throttlingRateLimit:RouteSettings' :: RouteSettings -> Maybe Double
$sel:throttlingBurstLimit:RouteSettings' :: RouteSettings -> Maybe Int
$sel:loggingLevel:RouteSettings' :: RouteSettings -> Maybe LoggingLevel
$sel:detailedMetricsEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
$sel:dataTraceEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dataTraceEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
detailedMetricsEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoggingLevel
loggingLevel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
throttlingBurstLimit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
throttlingRateLimit
instance Data.ToJSON RouteSettings where
toJSON :: RouteSettings -> Value
toJSON RouteSettings' {Maybe Bool
Maybe Double
Maybe Int
Maybe LoggingLevel
throttlingRateLimit :: Maybe Double
throttlingBurstLimit :: Maybe Int
loggingLevel :: Maybe LoggingLevel
detailedMetricsEnabled :: Maybe Bool
dataTraceEnabled :: Maybe Bool
$sel:throttlingRateLimit:RouteSettings' :: RouteSettings -> Maybe Double
$sel:throttlingBurstLimit:RouteSettings' :: RouteSettings -> Maybe Int
$sel:loggingLevel:RouteSettings' :: RouteSettings -> Maybe LoggingLevel
$sel:detailedMetricsEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
$sel:dataTraceEnabled:RouteSettings' :: RouteSettings -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"dataTraceEnabled" 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 Bool
dataTraceEnabled,
(Key
"detailedMetricsEnabled" 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 Bool
detailedMetricsEnabled,
(Key
"loggingLevel" 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 LoggingLevel
loggingLevel,
(Key
"throttlingBurstLimit" 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 Int
throttlingBurstLimit,
(Key
"throttlingRateLimit" 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 Double
throttlingRateLimit
]
)