{-# 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.XRay.Types.SamplingStatisticsDocument where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SamplingStatisticsDocument = SamplingStatisticsDocument'
{
SamplingStatisticsDocument -> Maybe Natural
borrowCount :: Prelude.Maybe Prelude.Natural,
SamplingStatisticsDocument -> Text
ruleName :: Prelude.Text,
SamplingStatisticsDocument -> Text
clientID :: Prelude.Text,
SamplingStatisticsDocument -> POSIX
timestamp :: Core.POSIX,
SamplingStatisticsDocument -> Natural
requestCount :: Prelude.Natural,
SamplingStatisticsDocument -> Natural
sampledCount :: Prelude.Natural
}
deriving (SamplingStatisticsDocument -> SamplingStatisticsDocument -> Bool
(SamplingStatisticsDocument -> SamplingStatisticsDocument -> Bool)
-> (SamplingStatisticsDocument
-> SamplingStatisticsDocument -> Bool)
-> Eq SamplingStatisticsDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplingStatisticsDocument -> SamplingStatisticsDocument -> Bool
$c/= :: SamplingStatisticsDocument -> SamplingStatisticsDocument -> Bool
== :: SamplingStatisticsDocument -> SamplingStatisticsDocument -> Bool
$c== :: SamplingStatisticsDocument -> SamplingStatisticsDocument -> Bool
Prelude.Eq, ReadPrec [SamplingStatisticsDocument]
ReadPrec SamplingStatisticsDocument
Int -> ReadS SamplingStatisticsDocument
ReadS [SamplingStatisticsDocument]
(Int -> ReadS SamplingStatisticsDocument)
-> ReadS [SamplingStatisticsDocument]
-> ReadPrec SamplingStatisticsDocument
-> ReadPrec [SamplingStatisticsDocument]
-> Read SamplingStatisticsDocument
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SamplingStatisticsDocument]
$creadListPrec :: ReadPrec [SamplingStatisticsDocument]
readPrec :: ReadPrec SamplingStatisticsDocument
$creadPrec :: ReadPrec SamplingStatisticsDocument
readList :: ReadS [SamplingStatisticsDocument]
$creadList :: ReadS [SamplingStatisticsDocument]
readsPrec :: Int -> ReadS SamplingStatisticsDocument
$creadsPrec :: Int -> ReadS SamplingStatisticsDocument
Prelude.Read, Int -> SamplingStatisticsDocument -> ShowS
[SamplingStatisticsDocument] -> ShowS
SamplingStatisticsDocument -> String
(Int -> SamplingStatisticsDocument -> ShowS)
-> (SamplingStatisticsDocument -> String)
-> ([SamplingStatisticsDocument] -> ShowS)
-> Show SamplingStatisticsDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SamplingStatisticsDocument] -> ShowS
$cshowList :: [SamplingStatisticsDocument] -> ShowS
show :: SamplingStatisticsDocument -> String
$cshow :: SamplingStatisticsDocument -> String
showsPrec :: Int -> SamplingStatisticsDocument -> ShowS
$cshowsPrec :: Int -> SamplingStatisticsDocument -> ShowS
Prelude.Show, (forall x.
SamplingStatisticsDocument -> Rep SamplingStatisticsDocument x)
-> (forall x.
Rep SamplingStatisticsDocument x -> SamplingStatisticsDocument)
-> Generic SamplingStatisticsDocument
forall x.
Rep SamplingStatisticsDocument x -> SamplingStatisticsDocument
forall x.
SamplingStatisticsDocument -> Rep SamplingStatisticsDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SamplingStatisticsDocument x -> SamplingStatisticsDocument
$cfrom :: forall x.
SamplingStatisticsDocument -> Rep SamplingStatisticsDocument x
Prelude.Generic)
newSamplingStatisticsDocument ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Natural ->
Prelude.Natural ->
SamplingStatisticsDocument
newSamplingStatisticsDocument :: Text
-> Text
-> UTCTime
-> Natural
-> Natural
-> SamplingStatisticsDocument
newSamplingStatisticsDocument
Text
pRuleName_
Text
pClientID_
UTCTime
pTimestamp_
Natural
pRequestCount_
Natural
pSampledCount_ =
SamplingStatisticsDocument' :: Maybe Natural
-> Text
-> Text
-> POSIX
-> Natural
-> Natural
-> SamplingStatisticsDocument
SamplingStatisticsDocument'
{ $sel:borrowCount:SamplingStatisticsDocument' :: Maybe Natural
borrowCount =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:ruleName:SamplingStatisticsDocument' :: Text
ruleName = Text
pRuleName_,
$sel:clientID:SamplingStatisticsDocument' :: Text
clientID = Text
pClientID_,
$sel:timestamp:SamplingStatisticsDocument' :: POSIX
timestamp = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pTimestamp_,
$sel:requestCount:SamplingStatisticsDocument' :: Natural
requestCount = Natural
pRequestCount_,
$sel:sampledCount:SamplingStatisticsDocument' :: Natural
sampledCount = Natural
pSampledCount_
}
samplingStatisticsDocument_borrowCount :: Lens.Lens' SamplingStatisticsDocument (Prelude.Maybe Prelude.Natural)
samplingStatisticsDocument_borrowCount :: (Maybe Natural -> f (Maybe Natural))
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument
samplingStatisticsDocument_borrowCount = (SamplingStatisticsDocument -> Maybe Natural)
-> (SamplingStatisticsDocument
-> Maybe Natural -> SamplingStatisticsDocument)
-> Lens
SamplingStatisticsDocument
SamplingStatisticsDocument
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingStatisticsDocument' {Maybe Natural
borrowCount :: Maybe Natural
$sel:borrowCount:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Maybe Natural
borrowCount} -> Maybe Natural
borrowCount) (\s :: SamplingStatisticsDocument
s@SamplingStatisticsDocument' {} Maybe Natural
a -> SamplingStatisticsDocument
s {$sel:borrowCount:SamplingStatisticsDocument' :: Maybe Natural
borrowCount = Maybe Natural
a} :: SamplingStatisticsDocument)
samplingStatisticsDocument_ruleName :: Lens.Lens' SamplingStatisticsDocument Prelude.Text
samplingStatisticsDocument_ruleName :: (Text -> f Text)
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument
samplingStatisticsDocument_ruleName = (SamplingStatisticsDocument -> Text)
-> (SamplingStatisticsDocument
-> Text -> SamplingStatisticsDocument)
-> Lens
SamplingStatisticsDocument SamplingStatisticsDocument Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingStatisticsDocument' {Text
ruleName :: Text
$sel:ruleName:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Text
ruleName} -> Text
ruleName) (\s :: SamplingStatisticsDocument
s@SamplingStatisticsDocument' {} Text
a -> SamplingStatisticsDocument
s {$sel:ruleName:SamplingStatisticsDocument' :: Text
ruleName = Text
a} :: SamplingStatisticsDocument)
samplingStatisticsDocument_clientID :: Lens.Lens' SamplingStatisticsDocument Prelude.Text
samplingStatisticsDocument_clientID :: (Text -> f Text)
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument
samplingStatisticsDocument_clientID = (SamplingStatisticsDocument -> Text)
-> (SamplingStatisticsDocument
-> Text -> SamplingStatisticsDocument)
-> Lens
SamplingStatisticsDocument SamplingStatisticsDocument Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingStatisticsDocument' {Text
clientID :: Text
$sel:clientID:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Text
clientID} -> Text
clientID) (\s :: SamplingStatisticsDocument
s@SamplingStatisticsDocument' {} Text
a -> SamplingStatisticsDocument
s {$sel:clientID:SamplingStatisticsDocument' :: Text
clientID = Text
a} :: SamplingStatisticsDocument)
samplingStatisticsDocument_timestamp :: Lens.Lens' SamplingStatisticsDocument Prelude.UTCTime
samplingStatisticsDocument_timestamp :: (UTCTime -> f UTCTime)
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument
samplingStatisticsDocument_timestamp = (SamplingStatisticsDocument -> POSIX)
-> (SamplingStatisticsDocument
-> POSIX -> SamplingStatisticsDocument)
-> Lens
SamplingStatisticsDocument SamplingStatisticsDocument POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingStatisticsDocument' {POSIX
timestamp :: POSIX
$sel:timestamp:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> POSIX
timestamp} -> POSIX
timestamp) (\s :: SamplingStatisticsDocument
s@SamplingStatisticsDocument' {} POSIX
a -> SamplingStatisticsDocument
s {$sel:timestamp:SamplingStatisticsDocument' :: POSIX
timestamp = POSIX
a} :: SamplingStatisticsDocument) ((POSIX -> f POSIX)
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> SamplingStatisticsDocument
-> f SamplingStatisticsDocument
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
samplingStatisticsDocument_requestCount :: Lens.Lens' SamplingStatisticsDocument Prelude.Natural
samplingStatisticsDocument_requestCount :: (Natural -> f Natural)
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument
samplingStatisticsDocument_requestCount = (SamplingStatisticsDocument -> Natural)
-> (SamplingStatisticsDocument
-> Natural -> SamplingStatisticsDocument)
-> Lens
SamplingStatisticsDocument
SamplingStatisticsDocument
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingStatisticsDocument' {Natural
requestCount :: Natural
$sel:requestCount:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Natural
requestCount} -> Natural
requestCount) (\s :: SamplingStatisticsDocument
s@SamplingStatisticsDocument' {} Natural
a -> SamplingStatisticsDocument
s {$sel:requestCount:SamplingStatisticsDocument' :: Natural
requestCount = Natural
a} :: SamplingStatisticsDocument)
samplingStatisticsDocument_sampledCount :: Lens.Lens' SamplingStatisticsDocument Prelude.Natural
samplingStatisticsDocument_sampledCount :: (Natural -> f Natural)
-> SamplingStatisticsDocument -> f SamplingStatisticsDocument
samplingStatisticsDocument_sampledCount = (SamplingStatisticsDocument -> Natural)
-> (SamplingStatisticsDocument
-> Natural -> SamplingStatisticsDocument)
-> Lens
SamplingStatisticsDocument
SamplingStatisticsDocument
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingStatisticsDocument' {Natural
sampledCount :: Natural
$sel:sampledCount:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Natural
sampledCount} -> Natural
sampledCount) (\s :: SamplingStatisticsDocument
s@SamplingStatisticsDocument' {} Natural
a -> SamplingStatisticsDocument
s {$sel:sampledCount:SamplingStatisticsDocument' :: Natural
sampledCount = Natural
a} :: SamplingStatisticsDocument)
instance Prelude.Hashable SamplingStatisticsDocument
instance Prelude.NFData SamplingStatisticsDocument
instance Core.ToJSON SamplingStatisticsDocument where
toJSON :: SamplingStatisticsDocument -> Value
toJSON SamplingStatisticsDocument' {Natural
Maybe Natural
Text
POSIX
sampledCount :: Natural
requestCount :: Natural
timestamp :: POSIX
clientID :: Text
ruleName :: Text
borrowCount :: Maybe Natural
$sel:sampledCount:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Natural
$sel:requestCount:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Natural
$sel:timestamp:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> POSIX
$sel:clientID:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Text
$sel:ruleName:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Text
$sel:borrowCount:SamplingStatisticsDocument' :: SamplingStatisticsDocument -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"BorrowCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
borrowCount,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RuleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientID" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientID),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Timestamp" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
timestamp),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RequestCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
requestCount),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SampledCount" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
sampledCount)
]
)