module Stratosphere.IoT.SecurityProfile.MetricToRetainProperty (
        module Exports, MetricToRetainProperty(..),
        mkMetricToRetainProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoT.SecurityProfile.MetricDimensionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricToRetainProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-securityprofile-metrictoretain.html>
    MetricToRetainProperty {MetricToRetainProperty -> ()
haddock_workaround_ :: (),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-securityprofile-metrictoretain.html#cfn-iot-securityprofile-metrictoretain-exportmetric>
                            MetricToRetainProperty -> Maybe (Value Bool)
exportMetric :: (Prelude.Maybe (Value Prelude.Bool)),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-securityprofile-metrictoretain.html#cfn-iot-securityprofile-metrictoretain-metric>
                            MetricToRetainProperty -> Value Text
metric :: (Value Prelude.Text),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iot-securityprofile-metrictoretain.html#cfn-iot-securityprofile-metrictoretain-metricdimension>
                            MetricToRetainProperty -> Maybe MetricDimensionProperty
metricDimension :: (Prelude.Maybe MetricDimensionProperty)}
  deriving stock (MetricToRetainProperty -> MetricToRetainProperty -> Bool
(MetricToRetainProperty -> MetricToRetainProperty -> Bool)
-> (MetricToRetainProperty -> MetricToRetainProperty -> Bool)
-> Eq MetricToRetainProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricToRetainProperty -> MetricToRetainProperty -> Bool
== :: MetricToRetainProperty -> MetricToRetainProperty -> Bool
$c/= :: MetricToRetainProperty -> MetricToRetainProperty -> Bool
/= :: MetricToRetainProperty -> MetricToRetainProperty -> Bool
Prelude.Eq, Int -> MetricToRetainProperty -> ShowS
[MetricToRetainProperty] -> ShowS
MetricToRetainProperty -> String
(Int -> MetricToRetainProperty -> ShowS)
-> (MetricToRetainProperty -> String)
-> ([MetricToRetainProperty] -> ShowS)
-> Show MetricToRetainProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricToRetainProperty -> ShowS
showsPrec :: Int -> MetricToRetainProperty -> ShowS
$cshow :: MetricToRetainProperty -> String
show :: MetricToRetainProperty -> String
$cshowList :: [MetricToRetainProperty] -> ShowS
showList :: [MetricToRetainProperty] -> ShowS
Prelude.Show)
mkMetricToRetainProperty ::
  Value Prelude.Text -> MetricToRetainProperty
mkMetricToRetainProperty :: Value Text -> MetricToRetainProperty
mkMetricToRetainProperty Value Text
metric
  = MetricToRetainProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), metric :: Value Text
metric = Value Text
metric,
       exportMetric :: Maybe (Value Bool)
exportMetric = Maybe (Value Bool)
forall a. Maybe a
Prelude.Nothing, metricDimension :: Maybe MetricDimensionProperty
metricDimension = Maybe MetricDimensionProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricToRetainProperty where
  toResourceProperties :: MetricToRetainProperty -> ResourceProperties
toResourceProperties MetricToRetainProperty {Maybe (Value Bool)
Maybe MetricDimensionProperty
()
Value Text
haddock_workaround_ :: MetricToRetainProperty -> ()
exportMetric :: MetricToRetainProperty -> Maybe (Value Bool)
metric :: MetricToRetainProperty -> Value Text
metricDimension :: MetricToRetainProperty -> Maybe MetricDimensionProperty
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoT::SecurityProfile.MetricToRetain",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"Metric" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
metric]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ExportMetric" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
exportMetric,
                               Key -> MetricDimensionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MetricDimension" (MetricDimensionProperty -> (Key, Value))
-> Maybe MetricDimensionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MetricDimensionProperty
metricDimension]))}
instance JSON.ToJSON MetricToRetainProperty where
  toJSON :: MetricToRetainProperty -> Value
toJSON MetricToRetainProperty {Maybe (Value Bool)
Maybe MetricDimensionProperty
()
Value Text
haddock_workaround_ :: MetricToRetainProperty -> ()
exportMetric :: MetricToRetainProperty -> Maybe (Value Bool)
metric :: MetricToRetainProperty -> Value Text
metricDimension :: MetricToRetainProperty -> Maybe MetricDimensionProperty
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"Metric" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
metric]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> Value Bool -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ExportMetric" (Value Bool -> (Key, Value))
-> Maybe (Value Bool) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Bool)
exportMetric,
                  Key -> MetricDimensionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MetricDimension" (MetricDimensionProperty -> (Key, Value))
-> Maybe MetricDimensionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MetricDimensionProperty
metricDimension])))
instance Property "ExportMetric" MetricToRetainProperty where
  type PropertyType "ExportMetric" MetricToRetainProperty = Value Prelude.Bool
  set :: PropertyType "ExportMetric" MetricToRetainProperty
-> MetricToRetainProperty -> MetricToRetainProperty
set PropertyType "ExportMetric" MetricToRetainProperty
newValue MetricToRetainProperty {Maybe (Value Bool)
Maybe MetricDimensionProperty
()
Value Text
haddock_workaround_ :: MetricToRetainProperty -> ()
exportMetric :: MetricToRetainProperty -> Maybe (Value Bool)
metric :: MetricToRetainProperty -> Value Text
metricDimension :: MetricToRetainProperty -> Maybe MetricDimensionProperty
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
..}
    = MetricToRetainProperty {exportMetric :: Maybe (Value Bool)
exportMetric = Value Bool -> Maybe (Value Bool)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ExportMetric" MetricToRetainProperty
Value Bool
newValue, Maybe MetricDimensionProperty
()
Value Text
haddock_workaround_ :: ()
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
haddock_workaround_ :: ()
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
..}
instance Property "Metric" MetricToRetainProperty where
  type PropertyType "Metric" MetricToRetainProperty = Value Prelude.Text
  set :: PropertyType "Metric" MetricToRetainProperty
-> MetricToRetainProperty -> MetricToRetainProperty
set PropertyType "Metric" MetricToRetainProperty
newValue MetricToRetainProperty {Maybe (Value Bool)
Maybe MetricDimensionProperty
()
Value Text
haddock_workaround_ :: MetricToRetainProperty -> ()
exportMetric :: MetricToRetainProperty -> Maybe (Value Bool)
metric :: MetricToRetainProperty -> Value Text
metricDimension :: MetricToRetainProperty -> Maybe MetricDimensionProperty
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
..}
    = MetricToRetainProperty {metric :: Value Text
metric = PropertyType "Metric" MetricToRetainProperty
Value Text
newValue, Maybe (Value Bool)
Maybe MetricDimensionProperty
()
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metricDimension :: Maybe MetricDimensionProperty
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metricDimension :: Maybe MetricDimensionProperty
..}
instance Property "MetricDimension" MetricToRetainProperty where
  type PropertyType "MetricDimension" MetricToRetainProperty = MetricDimensionProperty
  set :: PropertyType "MetricDimension" MetricToRetainProperty
-> MetricToRetainProperty -> MetricToRetainProperty
set PropertyType "MetricDimension" MetricToRetainProperty
newValue MetricToRetainProperty {Maybe (Value Bool)
Maybe MetricDimensionProperty
()
Value Text
haddock_workaround_ :: MetricToRetainProperty -> ()
exportMetric :: MetricToRetainProperty -> Maybe (Value Bool)
metric :: MetricToRetainProperty -> Value Text
metricDimension :: MetricToRetainProperty -> Maybe MetricDimensionProperty
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
metricDimension :: Maybe MetricDimensionProperty
..}
    = MetricToRetainProperty
        {metricDimension :: Maybe MetricDimensionProperty
metricDimension = MetricDimensionProperty -> Maybe MetricDimensionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MetricDimension" MetricToRetainProperty
MetricDimensionProperty
newValue, Maybe (Value Bool)
()
Value Text
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
haddock_workaround_ :: ()
exportMetric :: Maybe (Value Bool)
metric :: Value Text
..}