{-# 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.SamplingTargetDocument where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SamplingTargetDocument = SamplingTargetDocument'
{
SamplingTargetDocument -> Maybe Int
reservoirQuota :: Prelude.Maybe Prelude.Int,
SamplingTargetDocument -> Maybe Text
ruleName :: Prelude.Maybe Prelude.Text,
SamplingTargetDocument -> Maybe Double
fixedRate :: Prelude.Maybe Prelude.Double,
SamplingTargetDocument -> Maybe Int
interval :: Prelude.Maybe Prelude.Int,
SamplingTargetDocument -> Maybe POSIX
reservoirQuotaTTL :: Prelude.Maybe Core.POSIX
}
deriving (SamplingTargetDocument -> SamplingTargetDocument -> Bool
(SamplingTargetDocument -> SamplingTargetDocument -> Bool)
-> (SamplingTargetDocument -> SamplingTargetDocument -> Bool)
-> Eq SamplingTargetDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplingTargetDocument -> SamplingTargetDocument -> Bool
$c/= :: SamplingTargetDocument -> SamplingTargetDocument -> Bool
== :: SamplingTargetDocument -> SamplingTargetDocument -> Bool
$c== :: SamplingTargetDocument -> SamplingTargetDocument -> Bool
Prelude.Eq, ReadPrec [SamplingTargetDocument]
ReadPrec SamplingTargetDocument
Int -> ReadS SamplingTargetDocument
ReadS [SamplingTargetDocument]
(Int -> ReadS SamplingTargetDocument)
-> ReadS [SamplingTargetDocument]
-> ReadPrec SamplingTargetDocument
-> ReadPrec [SamplingTargetDocument]
-> Read SamplingTargetDocument
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SamplingTargetDocument]
$creadListPrec :: ReadPrec [SamplingTargetDocument]
readPrec :: ReadPrec SamplingTargetDocument
$creadPrec :: ReadPrec SamplingTargetDocument
readList :: ReadS [SamplingTargetDocument]
$creadList :: ReadS [SamplingTargetDocument]
readsPrec :: Int -> ReadS SamplingTargetDocument
$creadsPrec :: Int -> ReadS SamplingTargetDocument
Prelude.Read, Int -> SamplingTargetDocument -> ShowS
[SamplingTargetDocument] -> ShowS
SamplingTargetDocument -> String
(Int -> SamplingTargetDocument -> ShowS)
-> (SamplingTargetDocument -> String)
-> ([SamplingTargetDocument] -> ShowS)
-> Show SamplingTargetDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SamplingTargetDocument] -> ShowS
$cshowList :: [SamplingTargetDocument] -> ShowS
show :: SamplingTargetDocument -> String
$cshow :: SamplingTargetDocument -> String
showsPrec :: Int -> SamplingTargetDocument -> ShowS
$cshowsPrec :: Int -> SamplingTargetDocument -> ShowS
Prelude.Show, (forall x. SamplingTargetDocument -> Rep SamplingTargetDocument x)
-> (forall x.
Rep SamplingTargetDocument x -> SamplingTargetDocument)
-> Generic SamplingTargetDocument
forall x. Rep SamplingTargetDocument x -> SamplingTargetDocument
forall x. SamplingTargetDocument -> Rep SamplingTargetDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SamplingTargetDocument x -> SamplingTargetDocument
$cfrom :: forall x. SamplingTargetDocument -> Rep SamplingTargetDocument x
Prelude.Generic)
newSamplingTargetDocument ::
SamplingTargetDocument
newSamplingTargetDocument :: SamplingTargetDocument
newSamplingTargetDocument =
SamplingTargetDocument' :: Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe POSIX
-> SamplingTargetDocument
SamplingTargetDocument'
{ $sel:reservoirQuota:SamplingTargetDocument' :: Maybe Int
reservoirQuota =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:ruleName:SamplingTargetDocument' :: Maybe Text
ruleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fixedRate:SamplingTargetDocument' :: Maybe Double
fixedRate = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:interval:SamplingTargetDocument' :: Maybe Int
interval = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:reservoirQuotaTTL:SamplingTargetDocument' :: Maybe POSIX
reservoirQuotaTTL = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
samplingTargetDocument_reservoirQuota :: Lens.Lens' SamplingTargetDocument (Prelude.Maybe Prelude.Int)
samplingTargetDocument_reservoirQuota :: (Maybe Int -> f (Maybe Int))
-> SamplingTargetDocument -> f SamplingTargetDocument
samplingTargetDocument_reservoirQuota = (SamplingTargetDocument -> Maybe Int)
-> (SamplingTargetDocument -> Maybe Int -> SamplingTargetDocument)
-> Lens
SamplingTargetDocument
SamplingTargetDocument
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingTargetDocument' {Maybe Int
reservoirQuota :: Maybe Int
$sel:reservoirQuota:SamplingTargetDocument' :: SamplingTargetDocument -> Maybe Int
reservoirQuota} -> Maybe Int
reservoirQuota) (\s :: SamplingTargetDocument
s@SamplingTargetDocument' {} Maybe Int
a -> SamplingTargetDocument
s {$sel:reservoirQuota:SamplingTargetDocument' :: Maybe Int
reservoirQuota = Maybe Int
a} :: SamplingTargetDocument)
samplingTargetDocument_ruleName :: Lens.Lens' SamplingTargetDocument (Prelude.Maybe Prelude.Text)
samplingTargetDocument_ruleName :: (Maybe Text -> f (Maybe Text))
-> SamplingTargetDocument -> f SamplingTargetDocument
samplingTargetDocument_ruleName = (SamplingTargetDocument -> Maybe Text)
-> (SamplingTargetDocument -> Maybe Text -> SamplingTargetDocument)
-> Lens
SamplingTargetDocument
SamplingTargetDocument
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingTargetDocument' {Maybe Text
ruleName :: Maybe Text
$sel:ruleName:SamplingTargetDocument' :: SamplingTargetDocument -> Maybe Text
ruleName} -> Maybe Text
ruleName) (\s :: SamplingTargetDocument
s@SamplingTargetDocument' {} Maybe Text
a -> SamplingTargetDocument
s {$sel:ruleName:SamplingTargetDocument' :: Maybe Text
ruleName = Maybe Text
a} :: SamplingTargetDocument)
samplingTargetDocument_fixedRate :: Lens.Lens' SamplingTargetDocument (Prelude.Maybe Prelude.Double)
samplingTargetDocument_fixedRate :: (Maybe Double -> f (Maybe Double))
-> SamplingTargetDocument -> f SamplingTargetDocument
samplingTargetDocument_fixedRate = (SamplingTargetDocument -> Maybe Double)
-> (SamplingTargetDocument
-> Maybe Double -> SamplingTargetDocument)
-> Lens
SamplingTargetDocument
SamplingTargetDocument
(Maybe Double)
(Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingTargetDocument' {Maybe Double
fixedRate :: Maybe Double
$sel:fixedRate:SamplingTargetDocument' :: SamplingTargetDocument -> Maybe Double
fixedRate} -> Maybe Double
fixedRate) (\s :: SamplingTargetDocument
s@SamplingTargetDocument' {} Maybe Double
a -> SamplingTargetDocument
s {$sel:fixedRate:SamplingTargetDocument' :: Maybe Double
fixedRate = Maybe Double
a} :: SamplingTargetDocument)
samplingTargetDocument_interval :: Lens.Lens' SamplingTargetDocument (Prelude.Maybe Prelude.Int)
samplingTargetDocument_interval :: (Maybe Int -> f (Maybe Int))
-> SamplingTargetDocument -> f SamplingTargetDocument
samplingTargetDocument_interval = (SamplingTargetDocument -> Maybe Int)
-> (SamplingTargetDocument -> Maybe Int -> SamplingTargetDocument)
-> Lens
SamplingTargetDocument
SamplingTargetDocument
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingTargetDocument' {Maybe Int
interval :: Maybe Int
$sel:interval:SamplingTargetDocument' :: SamplingTargetDocument -> Maybe Int
interval} -> Maybe Int
interval) (\s :: SamplingTargetDocument
s@SamplingTargetDocument' {} Maybe Int
a -> SamplingTargetDocument
s {$sel:interval:SamplingTargetDocument' :: Maybe Int
interval = Maybe Int
a} :: SamplingTargetDocument)
samplingTargetDocument_reservoirQuotaTTL :: Lens.Lens' SamplingTargetDocument (Prelude.Maybe Prelude.UTCTime)
samplingTargetDocument_reservoirQuotaTTL :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SamplingTargetDocument -> f SamplingTargetDocument
samplingTargetDocument_reservoirQuotaTTL = (SamplingTargetDocument -> Maybe POSIX)
-> (SamplingTargetDocument
-> Maybe POSIX -> SamplingTargetDocument)
-> Lens
SamplingTargetDocument
SamplingTargetDocument
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingTargetDocument' {Maybe POSIX
reservoirQuotaTTL :: Maybe POSIX
$sel:reservoirQuotaTTL:SamplingTargetDocument' :: SamplingTargetDocument -> Maybe POSIX
reservoirQuotaTTL} -> Maybe POSIX
reservoirQuotaTTL) (\s :: SamplingTargetDocument
s@SamplingTargetDocument' {} Maybe POSIX
a -> SamplingTargetDocument
s {$sel:reservoirQuotaTTL:SamplingTargetDocument' :: Maybe POSIX
reservoirQuotaTTL = Maybe POSIX
a} :: SamplingTargetDocument) ((Maybe POSIX -> f (Maybe POSIX))
-> SamplingTargetDocument -> f SamplingTargetDocument)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SamplingTargetDocument
-> f SamplingTargetDocument
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON SamplingTargetDocument where
parseJSON :: Value -> Parser SamplingTargetDocument
parseJSON =
String
-> (Object -> Parser SamplingTargetDocument)
-> Value
-> Parser SamplingTargetDocument
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SamplingTargetDocument"
( \Object
x ->
Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe POSIX
-> SamplingTargetDocument
SamplingTargetDocument'
(Maybe Int
-> Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe POSIX
-> SamplingTargetDocument)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe POSIX
-> SamplingTargetDocument)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReservoirQuota")
Parser
(Maybe Text
-> Maybe Double
-> Maybe Int
-> Maybe POSIX
-> SamplingTargetDocument)
-> Parser (Maybe Text)
-> Parser
(Maybe Double
-> Maybe Int -> Maybe POSIX -> SamplingTargetDocument)
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
"RuleName")
Parser
(Maybe Double
-> Maybe Int -> Maybe POSIX -> SamplingTargetDocument)
-> Parser (Maybe Double)
-> Parser (Maybe Int -> Maybe POSIX -> SamplingTargetDocument)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FixedRate")
Parser (Maybe Int -> Maybe POSIX -> SamplingTargetDocument)
-> Parser (Maybe Int)
-> Parser (Maybe POSIX -> SamplingTargetDocument)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Interval")
Parser (Maybe POSIX -> SamplingTargetDocument)
-> Parser (Maybe POSIX) -> Parser SamplingTargetDocument
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReservoirQuotaTTL")
)
instance Prelude.Hashable SamplingTargetDocument
instance Prelude.NFData SamplingTargetDocument