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