module Stratosphere.XRay.SamplingRule (
        module Exports, SamplingRule(..), mkSamplingRule
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.XRay.SamplingRule.SamplingRuleProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
data SamplingRule
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-xray-samplingrule.html>
    SamplingRule {SamplingRule -> ()
haddock_workaround_ :: (),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-xray-samplingrule.html#cfn-xray-samplingrule-samplingrule>
                  SamplingRule -> Maybe SamplingRuleProperty
samplingRule :: (Prelude.Maybe SamplingRuleProperty),
                  -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-xray-samplingrule.html#cfn-xray-samplingrule-tags>
                  SamplingRule -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (SamplingRule -> SamplingRule -> Bool
(SamplingRule -> SamplingRule -> Bool)
-> (SamplingRule -> SamplingRule -> Bool) -> Eq SamplingRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SamplingRule -> SamplingRule -> Bool
== :: SamplingRule -> SamplingRule -> Bool
$c/= :: SamplingRule -> SamplingRule -> Bool
/= :: SamplingRule -> SamplingRule -> Bool
Prelude.Eq, Int -> SamplingRule -> ShowS
[SamplingRule] -> ShowS
SamplingRule -> String
(Int -> SamplingRule -> ShowS)
-> (SamplingRule -> String)
-> ([SamplingRule] -> ShowS)
-> Show SamplingRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SamplingRule -> ShowS
showsPrec :: Int -> SamplingRule -> ShowS
$cshow :: SamplingRule -> String
show :: SamplingRule -> String
$cshowList :: [SamplingRule] -> ShowS
showList :: [SamplingRule] -> ShowS
Prelude.Show)
mkSamplingRule :: SamplingRule
mkSamplingRule :: SamplingRule
mkSamplingRule
  = SamplingRule
      {haddock_workaround_ :: ()
haddock_workaround_ = (), samplingRule :: Maybe SamplingRuleProperty
samplingRule = Maybe SamplingRuleProperty
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties SamplingRule where
  toResourceProperties :: SamplingRule -> ResourceProperties
toResourceProperties SamplingRule {Maybe [Tag]
Maybe SamplingRuleProperty
()
haddock_workaround_ :: SamplingRule -> ()
samplingRule :: SamplingRule -> Maybe SamplingRuleProperty
tags :: SamplingRule -> Maybe [Tag]
haddock_workaround_ :: ()
samplingRule :: Maybe SamplingRuleProperty
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::XRay::SamplingRule", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> SamplingRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SamplingRule" (SamplingRuleProperty -> (Key, Value))
-> Maybe SamplingRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SamplingRuleProperty
samplingRule,
                            Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])}
instance JSON.ToJSON SamplingRule where
  toJSON :: SamplingRule -> Value
toJSON SamplingRule {Maybe [Tag]
Maybe SamplingRuleProperty
()
haddock_workaround_ :: SamplingRule -> ()
samplingRule :: SamplingRule -> Maybe SamplingRuleProperty
tags :: SamplingRule -> Maybe [Tag]
haddock_workaround_ :: ()
samplingRule :: Maybe SamplingRuleProperty
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> SamplingRuleProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"SamplingRule" (SamplingRuleProperty -> (Key, Value))
-> Maybe SamplingRuleProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SamplingRuleProperty
samplingRule,
               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))
instance Property "SamplingRule" SamplingRule where
  type PropertyType "SamplingRule" SamplingRule = SamplingRuleProperty
  set :: PropertyType "SamplingRule" SamplingRule
-> SamplingRule -> SamplingRule
set PropertyType "SamplingRule" SamplingRule
newValue SamplingRule {Maybe [Tag]
Maybe SamplingRuleProperty
()
haddock_workaround_ :: SamplingRule -> ()
samplingRule :: SamplingRule -> Maybe SamplingRuleProperty
tags :: SamplingRule -> Maybe [Tag]
haddock_workaround_ :: ()
samplingRule :: Maybe SamplingRuleProperty
tags :: Maybe [Tag]
..}
    = SamplingRule {samplingRule :: Maybe SamplingRuleProperty
samplingRule = SamplingRuleProperty -> Maybe SamplingRuleProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "SamplingRule" SamplingRule
SamplingRuleProperty
newValue, Maybe [Tag]
()
haddock_workaround_ :: ()
tags :: Maybe [Tag]
haddock_workaround_ :: ()
tags :: Maybe [Tag]
..}
instance Property "Tags" SamplingRule where
  type PropertyType "Tags" SamplingRule = [Tag]
  set :: PropertyType "Tags" SamplingRule -> SamplingRule -> SamplingRule
set PropertyType "Tags" SamplingRule
newValue SamplingRule {Maybe [Tag]
Maybe SamplingRuleProperty
()
haddock_workaround_ :: SamplingRule -> ()
samplingRule :: SamplingRule -> Maybe SamplingRuleProperty
tags :: SamplingRule -> Maybe [Tag]
haddock_workaround_ :: ()
samplingRule :: Maybe SamplingRuleProperty
tags :: Maybe [Tag]
..}
    = SamplingRule {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" SamplingRule
newValue, Maybe SamplingRuleProperty
()
haddock_workaround_ :: ()
samplingRule :: Maybe SamplingRuleProperty
haddock_workaround_ :: ()
samplingRule :: Maybe SamplingRuleProperty
..}