module Stratosphere.RUM.AppMonitor.MetricDestinationProperty (
        module Exports, MetricDestinationProperty(..),
        mkMetricDestinationProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.RUM.AppMonitor.MetricDefinitionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data MetricDestinationProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-metricdestination.html>
    MetricDestinationProperty {MetricDestinationProperty -> ()
haddock_workaround_ :: (),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-metricdestination.html#cfn-rum-appmonitor-metricdestination-destination>
                               MetricDestinationProperty -> Value Text
destination :: (Value Prelude.Text),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-metricdestination.html#cfn-rum-appmonitor-metricdestination-destinationarn>
                               MetricDestinationProperty -> Maybe (Value Text)
destinationArn :: (Prelude.Maybe (Value Prelude.Text)),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-metricdestination.html#cfn-rum-appmonitor-metricdestination-iamrolearn>
                               MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: (Prelude.Maybe (Value Prelude.Text)),
                               -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rum-appmonitor-metricdestination.html#cfn-rum-appmonitor-metricdestination-metricdefinitions>
                               MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
metricDefinitions :: (Prelude.Maybe [MetricDefinitionProperty])}
  deriving stock (MetricDestinationProperty -> MetricDestinationProperty -> Bool
(MetricDestinationProperty -> MetricDestinationProperty -> Bool)
-> (MetricDestinationProperty -> MetricDestinationProperty -> Bool)
-> Eq MetricDestinationProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MetricDestinationProperty -> MetricDestinationProperty -> Bool
== :: MetricDestinationProperty -> MetricDestinationProperty -> Bool
$c/= :: MetricDestinationProperty -> MetricDestinationProperty -> Bool
/= :: MetricDestinationProperty -> MetricDestinationProperty -> Bool
Prelude.Eq, Int -> MetricDestinationProperty -> ShowS
[MetricDestinationProperty] -> ShowS
MetricDestinationProperty -> String
(Int -> MetricDestinationProperty -> ShowS)
-> (MetricDestinationProperty -> String)
-> ([MetricDestinationProperty] -> ShowS)
-> Show MetricDestinationProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MetricDestinationProperty -> ShowS
showsPrec :: Int -> MetricDestinationProperty -> ShowS
$cshow :: MetricDestinationProperty -> String
show :: MetricDestinationProperty -> String
$cshowList :: [MetricDestinationProperty] -> ShowS
showList :: [MetricDestinationProperty] -> ShowS
Prelude.Show)
mkMetricDestinationProperty ::
  Value Prelude.Text -> MetricDestinationProperty
mkMetricDestinationProperty :: Value Text -> MetricDestinationProperty
mkMetricDestinationProperty Value Text
destination
  = MetricDestinationProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), destination :: Value Text
destination = Value Text
destination,
       destinationArn :: Maybe (Value Text)
destinationArn = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, iamRoleArn :: Maybe (Value Text)
iamRoleArn = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       metricDefinitions :: Maybe [MetricDefinitionProperty]
metricDefinitions = Maybe [MetricDefinitionProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties MetricDestinationProperty where
  toResourceProperties :: MetricDestinationProperty -> ResourceProperties
toResourceProperties MetricDestinationProperty {Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricDestinationProperty -> ()
destination :: MetricDestinationProperty -> Value Text
destinationArn :: MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: MetricDestinationProperty -> Maybe (Value Text)
metricDefinitions :: MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::RUM::AppMonitor.MetricDestination",
         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
"Destination" 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
destination]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [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..=) Key
"DestinationArn" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
destinationArn,
                               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..=) Key
"IamRoleArn" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
iamRoleArn,
                               Key -> [MetricDefinitionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MetricDefinitions" ([MetricDefinitionProperty] -> (Key, Value))
-> Maybe [MetricDefinitionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDefinitionProperty]
metricDefinitions]))}
instance JSON.ToJSON MetricDestinationProperty where
  toJSON :: MetricDestinationProperty -> Value
toJSON MetricDestinationProperty {Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricDestinationProperty -> ()
destination :: MetricDestinationProperty -> Value Text
destinationArn :: MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: MetricDestinationProperty -> Maybe (Value Text)
metricDefinitions :: MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
    = [(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
"Destination" 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
destination]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [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..=) Key
"DestinationArn" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
destinationArn,
                  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..=) Key
"IamRoleArn" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
iamRoleArn,
                  Key -> [MetricDefinitionProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MetricDefinitions" ([MetricDefinitionProperty] -> (Key, Value))
-> Maybe [MetricDefinitionProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDefinitionProperty]
metricDefinitions])))
instance Property "Destination" MetricDestinationProperty where
  type PropertyType "Destination" MetricDestinationProperty = Value Prelude.Text
  set :: PropertyType "Destination" MetricDestinationProperty
-> MetricDestinationProperty -> MetricDestinationProperty
set PropertyType "Destination" MetricDestinationProperty
newValue MetricDestinationProperty {Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricDestinationProperty -> ()
destination :: MetricDestinationProperty -> Value Text
destinationArn :: MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: MetricDestinationProperty -> Maybe (Value Text)
metricDefinitions :: MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
    = MetricDestinationProperty {destination :: Value Text
destination = PropertyType "Destination" MetricDestinationProperty
Value Text
newValue, Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
haddock_workaround_ :: ()
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
instance Property "DestinationArn" MetricDestinationProperty where
  type PropertyType "DestinationArn" MetricDestinationProperty = Value Prelude.Text
  set :: PropertyType "DestinationArn" MetricDestinationProperty
-> MetricDestinationProperty -> MetricDestinationProperty
set PropertyType "DestinationArn" MetricDestinationProperty
newValue MetricDestinationProperty {Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricDestinationProperty -> ()
destination :: MetricDestinationProperty -> Value Text
destinationArn :: MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: MetricDestinationProperty -> Maybe (Value Text)
metricDefinitions :: MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
    = MetricDestinationProperty
        {destinationArn :: Maybe (Value Text)
destinationArn = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DestinationArn" MetricDestinationProperty
Value Text
newValue, Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destination :: Value Text
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
instance Property "IamRoleArn" MetricDestinationProperty where
  type PropertyType "IamRoleArn" MetricDestinationProperty = Value Prelude.Text
  set :: PropertyType "IamRoleArn" MetricDestinationProperty
-> MetricDestinationProperty -> MetricDestinationProperty
set PropertyType "IamRoleArn" MetricDestinationProperty
newValue MetricDestinationProperty {Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricDestinationProperty -> ()
destination :: MetricDestinationProperty -> Value Text
destinationArn :: MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: MetricDestinationProperty -> Maybe (Value Text)
metricDefinitions :: MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
    = MetricDestinationProperty
        {iamRoleArn :: Maybe (Value Text)
iamRoleArn = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "IamRoleArn" MetricDestinationProperty
Value Text
newValue, Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
instance Property "MetricDefinitions" MetricDestinationProperty where
  type PropertyType "MetricDefinitions" MetricDestinationProperty = [MetricDefinitionProperty]
  set :: PropertyType "MetricDefinitions" MetricDestinationProperty
-> MetricDestinationProperty -> MetricDestinationProperty
set PropertyType "MetricDefinitions" MetricDestinationProperty
newValue MetricDestinationProperty {Maybe [MetricDefinitionProperty]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: MetricDestinationProperty -> ()
destination :: MetricDestinationProperty -> Value Text
destinationArn :: MetricDestinationProperty -> Maybe (Value Text)
iamRoleArn :: MetricDestinationProperty -> Maybe (Value Text)
metricDefinitions :: MetricDestinationProperty -> Maybe [MetricDefinitionProperty]
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
metricDefinitions :: Maybe [MetricDefinitionProperty]
..}
    = MetricDestinationProperty
        {metricDefinitions :: Maybe [MetricDefinitionProperty]
metricDefinitions = [MetricDefinitionProperty] -> Maybe [MetricDefinitionProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [MetricDefinitionProperty]
PropertyType "MetricDefinitions" MetricDestinationProperty
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
haddock_workaround_ :: ()
destination :: Value Text
destinationArn :: Maybe (Value Text)
iamRoleArn :: Maybe (Value Text)
..}