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