{-# 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.Kinesis.Types.EnhancedMetrics where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.Types.MetricsName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EnhancedMetrics = EnhancedMetrics'
{
EnhancedMetrics -> Maybe [MetricsName]
shardLevelMetrics :: Prelude.Maybe [MetricsName]
}
deriving (EnhancedMetrics -> EnhancedMetrics -> Bool
(EnhancedMetrics -> EnhancedMetrics -> Bool)
-> (EnhancedMetrics -> EnhancedMetrics -> Bool)
-> Eq EnhancedMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnhancedMetrics -> EnhancedMetrics -> Bool
$c/= :: EnhancedMetrics -> EnhancedMetrics -> Bool
== :: EnhancedMetrics -> EnhancedMetrics -> Bool
$c== :: EnhancedMetrics -> EnhancedMetrics -> Bool
Prelude.Eq, ReadPrec [EnhancedMetrics]
ReadPrec EnhancedMetrics
Int -> ReadS EnhancedMetrics
ReadS [EnhancedMetrics]
(Int -> ReadS EnhancedMetrics)
-> ReadS [EnhancedMetrics]
-> ReadPrec EnhancedMetrics
-> ReadPrec [EnhancedMetrics]
-> Read EnhancedMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnhancedMetrics]
$creadListPrec :: ReadPrec [EnhancedMetrics]
readPrec :: ReadPrec EnhancedMetrics
$creadPrec :: ReadPrec EnhancedMetrics
readList :: ReadS [EnhancedMetrics]
$creadList :: ReadS [EnhancedMetrics]
readsPrec :: Int -> ReadS EnhancedMetrics
$creadsPrec :: Int -> ReadS EnhancedMetrics
Prelude.Read, Int -> EnhancedMetrics -> ShowS
[EnhancedMetrics] -> ShowS
EnhancedMetrics -> String
(Int -> EnhancedMetrics -> ShowS)
-> (EnhancedMetrics -> String)
-> ([EnhancedMetrics] -> ShowS)
-> Show EnhancedMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnhancedMetrics] -> ShowS
$cshowList :: [EnhancedMetrics] -> ShowS
show :: EnhancedMetrics -> String
$cshow :: EnhancedMetrics -> String
showsPrec :: Int -> EnhancedMetrics -> ShowS
$cshowsPrec :: Int -> EnhancedMetrics -> ShowS
Prelude.Show, (forall x. EnhancedMetrics -> Rep EnhancedMetrics x)
-> (forall x. Rep EnhancedMetrics x -> EnhancedMetrics)
-> Generic EnhancedMetrics
forall x. Rep EnhancedMetrics x -> EnhancedMetrics
forall x. EnhancedMetrics -> Rep EnhancedMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnhancedMetrics x -> EnhancedMetrics
$cfrom :: forall x. EnhancedMetrics -> Rep EnhancedMetrics x
Prelude.Generic)
newEnhancedMetrics ::
EnhancedMetrics
newEnhancedMetrics :: EnhancedMetrics
newEnhancedMetrics =
EnhancedMetrics' :: Maybe [MetricsName] -> EnhancedMetrics
EnhancedMetrics'
{ $sel:shardLevelMetrics:EnhancedMetrics' :: Maybe [MetricsName]
shardLevelMetrics =
Maybe [MetricsName]
forall a. Maybe a
Prelude.Nothing
}
enhancedMetrics_shardLevelMetrics :: Lens.Lens' EnhancedMetrics (Prelude.Maybe [MetricsName])
enhancedMetrics_shardLevelMetrics :: (Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMetrics -> f EnhancedMetrics
enhancedMetrics_shardLevelMetrics = (EnhancedMetrics -> Maybe [MetricsName])
-> (EnhancedMetrics -> Maybe [MetricsName] -> EnhancedMetrics)
-> Lens
EnhancedMetrics
EnhancedMetrics
(Maybe [MetricsName])
(Maybe [MetricsName])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnhancedMetrics' {Maybe [MetricsName]
shardLevelMetrics :: Maybe [MetricsName]
$sel:shardLevelMetrics:EnhancedMetrics' :: EnhancedMetrics -> Maybe [MetricsName]
shardLevelMetrics} -> Maybe [MetricsName]
shardLevelMetrics) (\s :: EnhancedMetrics
s@EnhancedMetrics' {} Maybe [MetricsName]
a -> EnhancedMetrics
s {$sel:shardLevelMetrics:EnhancedMetrics' :: Maybe [MetricsName]
shardLevelMetrics = Maybe [MetricsName]
a} :: EnhancedMetrics) ((Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMetrics -> f EnhancedMetrics)
-> ((Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> (Maybe [MetricsName] -> f (Maybe [MetricsName]))
-> EnhancedMetrics
-> f EnhancedMetrics
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MetricsName] [MetricsName] [MetricsName] [MetricsName]
-> Iso
(Maybe [MetricsName])
(Maybe [MetricsName])
(Maybe [MetricsName])
(Maybe [MetricsName])
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 [MetricsName] [MetricsName] [MetricsName] [MetricsName]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON EnhancedMetrics where
parseJSON :: Value -> Parser EnhancedMetrics
parseJSON =
String
-> (Object -> Parser EnhancedMetrics)
-> Value
-> Parser EnhancedMetrics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EnhancedMetrics"
( \Object
x ->
Maybe [MetricsName] -> EnhancedMetrics
EnhancedMetrics'
(Maybe [MetricsName] -> EnhancedMetrics)
-> Parser (Maybe [MetricsName]) -> Parser EnhancedMetrics
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [MetricsName]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShardLevelMetrics"
Parser (Maybe (Maybe [MetricsName]))
-> Maybe [MetricsName] -> Parser (Maybe [MetricsName])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MetricsName]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable EnhancedMetrics
instance Prelude.NFData EnhancedMetrics