{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AutoScaling.Types.CustomizedMetricSpecification
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AutoScaling.Types.CustomizedMetricSpecification where

import Amazonka.AutoScaling.Types.MetricDimension
import Amazonka.AutoScaling.Types.MetricStatistic
import Amazonka.AutoScaling.Types.TargetTrackingMetricDataQuery
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Represents a CloudWatch metric of your choosing for a target tracking
-- scaling policy to use with Amazon EC2 Auto Scaling.
--
-- To create your customized metric specification:
--
-- -   Add values for each required property from CloudWatch. You can use
--     an existing metric, or a new metric that you create. To use your own
--     metric, you must first publish the metric to CloudWatch. For more
--     information, see
--     <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html Publish custom metrics>
--     in the /Amazon CloudWatch User Guide/.
--
-- -   Choose a metric that changes proportionally with capacity. The value
--     of the metric should increase or decrease in inverse proportion to
--     the number of capacity units. That is, the value of the metric
--     should decrease when capacity increases.
--
-- For more information about the CloudWatch terminology below, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html Amazon CloudWatch concepts>.
--
-- Each individual service provides information about the metrics,
-- namespace, and dimensions they use. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html Amazon Web Services services that publish CloudWatch metrics>
-- in the /Amazon CloudWatch User Guide/.
--
-- /See:/ 'newCustomizedMetricSpecification' smart constructor.
data CustomizedMetricSpecification = CustomizedMetricSpecification'
  { -- | The dimensions of the metric.
    --
    -- Conditional: If you published your metric with dimensions, you must
    -- specify the same dimensions in your scaling policy.
    CustomizedMetricSpecification -> Maybe [MetricDimension]
dimensions :: Prelude.Maybe [MetricDimension],
    -- | The name of the metric. To get the exact metric name, namespace, and
    -- dimensions, inspect the
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html Metric>
    -- object that is returned by a call to
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html ListMetrics>.
    CustomizedMetricSpecification -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | The metrics to include in the target tracking scaling policy, as a
    -- metric data query. This can include both raw metric and metric math
    -- expressions.
    CustomizedMetricSpecification
-> Maybe [TargetTrackingMetricDataQuery]
metrics :: Prelude.Maybe [TargetTrackingMetricDataQuery],
    -- | The namespace of the metric.
    CustomizedMetricSpecification -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
    -- | The statistic of the metric.
    CustomizedMetricSpecification -> Maybe MetricStatistic
statistic :: Prelude.Maybe MetricStatistic,
    -- | The unit of the metric. For a complete list of the units that CloudWatch
    -- supports, see the
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html MetricDatum>
    -- data type in the /Amazon CloudWatch API Reference/.
    CustomizedMetricSpecification -> Maybe Text
unit :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomizedMetricSpecification
-> CustomizedMetricSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomizedMetricSpecification
-> CustomizedMetricSpecification -> Bool
$c/= :: CustomizedMetricSpecification
-> CustomizedMetricSpecification -> Bool
== :: CustomizedMetricSpecification
-> CustomizedMetricSpecification -> Bool
$c== :: CustomizedMetricSpecification
-> CustomizedMetricSpecification -> Bool
Prelude.Eq, ReadPrec [CustomizedMetricSpecification]
ReadPrec CustomizedMetricSpecification
Int -> ReadS CustomizedMetricSpecification
ReadS [CustomizedMetricSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomizedMetricSpecification]
$creadListPrec :: ReadPrec [CustomizedMetricSpecification]
readPrec :: ReadPrec CustomizedMetricSpecification
$creadPrec :: ReadPrec CustomizedMetricSpecification
readList :: ReadS [CustomizedMetricSpecification]
$creadList :: ReadS [CustomizedMetricSpecification]
readsPrec :: Int -> ReadS CustomizedMetricSpecification
$creadsPrec :: Int -> ReadS CustomizedMetricSpecification
Prelude.Read, Int -> CustomizedMetricSpecification -> ShowS
[CustomizedMetricSpecification] -> ShowS
CustomizedMetricSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomizedMetricSpecification] -> ShowS
$cshowList :: [CustomizedMetricSpecification] -> ShowS
show :: CustomizedMetricSpecification -> String
$cshow :: CustomizedMetricSpecification -> String
showsPrec :: Int -> CustomizedMetricSpecification -> ShowS
$cshowsPrec :: Int -> CustomizedMetricSpecification -> ShowS
Prelude.Show, forall x.
Rep CustomizedMetricSpecification x
-> CustomizedMetricSpecification
forall x.
CustomizedMetricSpecification
-> Rep CustomizedMetricSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomizedMetricSpecification x
-> CustomizedMetricSpecification
$cfrom :: forall x.
CustomizedMetricSpecification
-> Rep CustomizedMetricSpecification x
Prelude.Generic)

-- |
-- Create a value of 'CustomizedMetricSpecification' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'dimensions', 'customizedMetricSpecification_dimensions' - The dimensions of the metric.
--
-- Conditional: If you published your metric with dimensions, you must
-- specify the same dimensions in your scaling policy.
--
-- 'metricName', 'customizedMetricSpecification_metricName' - The name of the metric. To get the exact metric name, namespace, and
-- dimensions, inspect the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html Metric>
-- object that is returned by a call to
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html ListMetrics>.
--
-- 'metrics', 'customizedMetricSpecification_metrics' - The metrics to include in the target tracking scaling policy, as a
-- metric data query. This can include both raw metric and metric math
-- expressions.
--
-- 'namespace', 'customizedMetricSpecification_namespace' - The namespace of the metric.
--
-- 'statistic', 'customizedMetricSpecification_statistic' - The statistic of the metric.
--
-- 'unit', 'customizedMetricSpecification_unit' - The unit of the metric. For a complete list of the units that CloudWatch
-- supports, see the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html MetricDatum>
-- data type in the /Amazon CloudWatch API Reference/.
newCustomizedMetricSpecification ::
  CustomizedMetricSpecification
newCustomizedMetricSpecification :: CustomizedMetricSpecification
newCustomizedMetricSpecification =
  CustomizedMetricSpecification'
    { $sel:dimensions:CustomizedMetricSpecification' :: Maybe [MetricDimension]
dimensions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:metricName:CustomizedMetricSpecification' :: Maybe Text
metricName = forall a. Maybe a
Prelude.Nothing,
      $sel:metrics:CustomizedMetricSpecification' :: Maybe [TargetTrackingMetricDataQuery]
metrics = forall a. Maybe a
Prelude.Nothing,
      $sel:namespace:CustomizedMetricSpecification' :: Maybe Text
namespace = forall a. Maybe a
Prelude.Nothing,
      $sel:statistic:CustomizedMetricSpecification' :: Maybe MetricStatistic
statistic = forall a. Maybe a
Prelude.Nothing,
      $sel:unit:CustomizedMetricSpecification' :: Maybe Text
unit = forall a. Maybe a
Prelude.Nothing
    }

-- | The dimensions of the metric.
--
-- Conditional: If you published your metric with dimensions, you must
-- specify the same dimensions in your scaling policy.
customizedMetricSpecification_dimensions :: Lens.Lens' CustomizedMetricSpecification (Prelude.Maybe [MetricDimension])
customizedMetricSpecification_dimensions :: Lens' CustomizedMetricSpecification (Maybe [MetricDimension])
customizedMetricSpecification_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedMetricSpecification' {Maybe [MetricDimension]
dimensions :: Maybe [MetricDimension]
$sel:dimensions:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe [MetricDimension]
dimensions} -> Maybe [MetricDimension]
dimensions) (\s :: CustomizedMetricSpecification
s@CustomizedMetricSpecification' {} Maybe [MetricDimension]
a -> CustomizedMetricSpecification
s {$sel:dimensions:CustomizedMetricSpecification' :: Maybe [MetricDimension]
dimensions = Maybe [MetricDimension]
a} :: CustomizedMetricSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the metric. To get the exact metric name, namespace, and
-- dimensions, inspect the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html Metric>
-- object that is returned by a call to
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html ListMetrics>.
customizedMetricSpecification_metricName :: Lens.Lens' CustomizedMetricSpecification (Prelude.Maybe Prelude.Text)
customizedMetricSpecification_metricName :: Lens' CustomizedMetricSpecification (Maybe Text)
customizedMetricSpecification_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedMetricSpecification' {Maybe Text
metricName :: Maybe Text
$sel:metricName:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: CustomizedMetricSpecification
s@CustomizedMetricSpecification' {} Maybe Text
a -> CustomizedMetricSpecification
s {$sel:metricName:CustomizedMetricSpecification' :: Maybe Text
metricName = Maybe Text
a} :: CustomizedMetricSpecification)

-- | The metrics to include in the target tracking scaling policy, as a
-- metric data query. This can include both raw metric and metric math
-- expressions.
customizedMetricSpecification_metrics :: Lens.Lens' CustomizedMetricSpecification (Prelude.Maybe [TargetTrackingMetricDataQuery])
customizedMetricSpecification_metrics :: Lens'
  CustomizedMetricSpecification
  (Maybe [TargetTrackingMetricDataQuery])
customizedMetricSpecification_metrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedMetricSpecification' {Maybe [TargetTrackingMetricDataQuery]
metrics :: Maybe [TargetTrackingMetricDataQuery]
$sel:metrics:CustomizedMetricSpecification' :: CustomizedMetricSpecification
-> Maybe [TargetTrackingMetricDataQuery]
metrics} -> Maybe [TargetTrackingMetricDataQuery]
metrics) (\s :: CustomizedMetricSpecification
s@CustomizedMetricSpecification' {} Maybe [TargetTrackingMetricDataQuery]
a -> CustomizedMetricSpecification
s {$sel:metrics:CustomizedMetricSpecification' :: Maybe [TargetTrackingMetricDataQuery]
metrics = Maybe [TargetTrackingMetricDataQuery]
a} :: CustomizedMetricSpecification) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The namespace of the metric.
customizedMetricSpecification_namespace :: Lens.Lens' CustomizedMetricSpecification (Prelude.Maybe Prelude.Text)
customizedMetricSpecification_namespace :: Lens' CustomizedMetricSpecification (Maybe Text)
customizedMetricSpecification_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedMetricSpecification' {Maybe Text
namespace :: Maybe Text
$sel:namespace:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: CustomizedMetricSpecification
s@CustomizedMetricSpecification' {} Maybe Text
a -> CustomizedMetricSpecification
s {$sel:namespace:CustomizedMetricSpecification' :: Maybe Text
namespace = Maybe Text
a} :: CustomizedMetricSpecification)

-- | The statistic of the metric.
customizedMetricSpecification_statistic :: Lens.Lens' CustomizedMetricSpecification (Prelude.Maybe MetricStatistic)
customizedMetricSpecification_statistic :: Lens' CustomizedMetricSpecification (Maybe MetricStatistic)
customizedMetricSpecification_statistic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedMetricSpecification' {Maybe MetricStatistic
statistic :: Maybe MetricStatistic
$sel:statistic:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe MetricStatistic
statistic} -> Maybe MetricStatistic
statistic) (\s :: CustomizedMetricSpecification
s@CustomizedMetricSpecification' {} Maybe MetricStatistic
a -> CustomizedMetricSpecification
s {$sel:statistic:CustomizedMetricSpecification' :: Maybe MetricStatistic
statistic = Maybe MetricStatistic
a} :: CustomizedMetricSpecification)

-- | The unit of the metric. For a complete list of the units that CloudWatch
-- supports, see the
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html MetricDatum>
-- data type in the /Amazon CloudWatch API Reference/.
customizedMetricSpecification_unit :: Lens.Lens' CustomizedMetricSpecification (Prelude.Maybe Prelude.Text)
customizedMetricSpecification_unit :: Lens' CustomizedMetricSpecification (Maybe Text)
customizedMetricSpecification_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomizedMetricSpecification' {Maybe Text
unit :: Maybe Text
$sel:unit:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
unit} -> Maybe Text
unit) (\s :: CustomizedMetricSpecification
s@CustomizedMetricSpecification' {} Maybe Text
a -> CustomizedMetricSpecification
s {$sel:unit:CustomizedMetricSpecification' :: Maybe Text
unit = Maybe Text
a} :: CustomizedMetricSpecification)

instance Data.FromXML CustomizedMetricSpecification where
  parseXML :: [Node] -> Either String CustomizedMetricSpecification
parseXML [Node]
x =
    Maybe [MetricDimension]
-> Maybe Text
-> Maybe [TargetTrackingMetricDataQuery]
-> Maybe Text
-> Maybe MetricStatistic
-> Maybe Text
-> CustomizedMetricSpecification
CustomizedMetricSpecification'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Dimensions"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"MetricName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Metrics"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Namespace")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Statistic")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Unit")

instance
  Prelude.Hashable
    CustomizedMetricSpecification
  where
  hashWithSalt :: Int -> CustomizedMetricSpecification -> Int
hashWithSalt Int
_salt CustomizedMetricSpecification' {Maybe [MetricDimension]
Maybe [TargetTrackingMetricDataQuery]
Maybe Text
Maybe MetricStatistic
unit :: Maybe Text
statistic :: Maybe MetricStatistic
namespace :: Maybe Text
metrics :: Maybe [TargetTrackingMetricDataQuery]
metricName :: Maybe Text
dimensions :: Maybe [MetricDimension]
$sel:unit:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:statistic:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe MetricStatistic
$sel:namespace:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:metrics:CustomizedMetricSpecification' :: CustomizedMetricSpecification
-> Maybe [TargetTrackingMetricDataQuery]
$sel:metricName:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:dimensions:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe [MetricDimension]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MetricDimension]
dimensions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metricName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TargetTrackingMetricDataQuery]
metrics
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
namespace
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MetricStatistic
statistic
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
unit

instance Prelude.NFData CustomizedMetricSpecification where
  rnf :: CustomizedMetricSpecification -> ()
rnf CustomizedMetricSpecification' {Maybe [MetricDimension]
Maybe [TargetTrackingMetricDataQuery]
Maybe Text
Maybe MetricStatistic
unit :: Maybe Text
statistic :: Maybe MetricStatistic
namespace :: Maybe Text
metrics :: Maybe [TargetTrackingMetricDataQuery]
metricName :: Maybe Text
dimensions :: Maybe [MetricDimension]
$sel:unit:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:statistic:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe MetricStatistic
$sel:namespace:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:metrics:CustomizedMetricSpecification' :: CustomizedMetricSpecification
-> Maybe [TargetTrackingMetricDataQuery]
$sel:metricName:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:dimensions:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe [MetricDimension]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [MetricDimension]
dimensions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TargetTrackingMetricDataQuery]
metrics
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
namespace
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MetricStatistic
statistic
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
unit

instance Data.ToQuery CustomizedMetricSpecification where
  toQuery :: CustomizedMetricSpecification -> QueryString
toQuery CustomizedMetricSpecification' {Maybe [MetricDimension]
Maybe [TargetTrackingMetricDataQuery]
Maybe Text
Maybe MetricStatistic
unit :: Maybe Text
statistic :: Maybe MetricStatistic
namespace :: Maybe Text
metrics :: Maybe [TargetTrackingMetricDataQuery]
metricName :: Maybe Text
dimensions :: Maybe [MetricDimension]
$sel:unit:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:statistic:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe MetricStatistic
$sel:namespace:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:metrics:CustomizedMetricSpecification' :: CustomizedMetricSpecification
-> Maybe [TargetTrackingMetricDataQuery]
$sel:metricName:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe Text
$sel:dimensions:CustomizedMetricSpecification' :: CustomizedMetricSpecification -> Maybe [MetricDimension]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Dimensions"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetricDimension]
dimensions),
        ByteString
"MetricName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
metricName,
        ByteString
"Metrics"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TargetTrackingMetricDataQuery]
metrics),
        ByteString
"Namespace" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
namespace,
        ByteString
"Statistic" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe MetricStatistic
statistic,
        ByteString
"Unit" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
unit
      ]