summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendanHay <>2015-08-16 14:12:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-08-16 14:12:00 (GMT)
commitc8e3b8999a90c672b224474b30ee1d25b2da8385 (patch)
treedd4a79c2c5a8318bd14a312c5f66ca8b91bc1344
parent5ba5e3bed7244719f125877cfdea107ea18c85d0 (diff)
version 1.0.01.0.0
-rw-r--r--README.md77
-rw-r--r--amazonka-cloudwatch.cabal111
-rw-r--r--gen/Network/AWS/CloudWatch.hs308
-rw-r--r--gen/Network/AWS/CloudWatch/DeleteAlarms.hs133
-rw-r--r--gen/Network/AWS/CloudWatch/DescribeAlarmHistory.hs275
-rw-r--r--gen/Network/AWS/CloudWatch/DescribeAlarms.hs278
-rw-r--r--gen/Network/AWS/CloudWatch/DescribeAlarmsForMetric.hs255
-rw-r--r--gen/Network/AWS/CloudWatch/DisableAlarmActions.hs134
-rw-r--r--gen/Network/AWS/CloudWatch/EnableAlarmActions.hs128
-rw-r--r--gen/Network/AWS/CloudWatch/GetMetricStatistics.hs376
-rw-r--r--gen/Network/AWS/CloudWatch/ListMetrics.hs246
-rw-r--r--gen/Network/AWS/CloudWatch/PutMetricAlarm.hs380
-rw-r--r--gen/Network/AWS/CloudWatch/PutMetricData.hs161
-rw-r--r--gen/Network/AWS/CloudWatch/SetAlarmState.hs191
-rw-r--r--gen/Network/AWS/CloudWatch/Types.hs1207
-rw-r--r--gen/Network/AWS/CloudWatch/Types/Product.hs705
-rw-r--r--gen/Network/AWS/CloudWatch/Types/Sum.hs241
-rw-r--r--gen/Network/AWS/CloudWatch/Waiters.hs20
-rw-r--r--test/Main.hs21
-rw-r--r--test/Test/AWS/CloudWatch.hs26
-rw-r--r--test/Test/AWS/CloudWatch/Internal.hs16
-rw-r--r--test/Test/AWS/Gen/CloudWatch.hs226
22 files changed, 3160 insertions, 2355 deletions
diff --git a/README.md b/README.md
index b21aa9f..aa28d2d 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,80 @@
# Amazon CloudWatch SDK
-> _Warning:_ This is an experimental preview release which is still under heavy development and not intended for public consumption, _caveat emptor_!
-
+* [Version](#version)
* [Description](#description)
* [Contribute](#contribute)
* [Licence](#licence)
+
+## Version
+
+`1.0.0`
+
+
## Description
-Amazon CloudWatch is a monitoring service for AWS cloud resources and the
-applications you run on AWS. You can use Amazon CloudWatch to collect and
-track metrics, collect and monitor log files, and set alarms. Amazon
-CloudWatch can monitor AWS resources such as Amazon EC2 instances, Amazon
-DynamoDB tables, and Amazon RDS DB instances, as well as custom metrics
-generated by your applications and services, and any log files your
-applications generate. You can use Amazon CloudWatch to gain system-wide
-visibility into resource utilization, application performance, and
-operational health. You can use these insights to react and keep your
-application running smoothly.
+This is the /Amazon CloudWatch API Reference/. This guide provides
+detailed information about Amazon CloudWatch actions, data types,
+parameters, and errors. For detailed information about Amazon CloudWatch
+features and their associated API calls, go to the
+<http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide Amazon CloudWatch Developer Guide>.
+
+Amazon CloudWatch is a web service that enables you to publish, monitor,
+and manage various metrics, as well as configure alarm actions based on
+data from metrics. For more information about this product go to
+<http://aws.amazon.com/cloudwatch>.
+
+For information about the namespace, metric names, and dimensions that
+other Amazon Web Services products use to send metrics to Cloudwatch, go
+to
+<http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference>
+in the /Amazon CloudWatch Developer Guide/.
+
+Use the following links to get started using the /Amazon CloudWatch API
+Reference/:
+
+- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Operations.html Actions>:
+ An alphabetical list of all Amazon CloudWatch actions.
+- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Types.html Data Types>:
+ An alphabetical list of all Amazon CloudWatch data types.
+- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonParameters.html Common Parameters>:
+ Parameters that all Query actions can use.
+- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonErrors.html Common Errors>:
+ Client and server errors that all actions can return.
+- <http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html Regions and Endpoints>:
+ Itemized regions and endpoints for all AWS products.
+- <http://monitoring.amazonaws.com/doc/2010-08-01/CloudWatch.wsdl WSDL Location>:
+ http:\/\/monitoring.amazonaws.com\/doc\/2010-08-01\/CloudWatch.wsdl
+
+In addition to using the Amazon CloudWatch API, you can also use the
+following SDKs and third-party libraries to access Amazon CloudWatch
+programmatically.
+
+- <http://aws.amazon.com/documentation/sdkforjava/ AWS SDK for Java Documentation>
+- <http://aws.amazon.com/documentation/sdkfornet/ AWS SDK for .NET Documentation>
+- <http://aws.amazon.com/documentation/sdkforphp/ AWS SDK for PHP Documentation>
+- <http://aws.amazon.com/documentation/sdkforruby/ AWS SDK for Ruby Documentation>
+
+Developers in the AWS developer community also provide their own
+libraries, which you can find at the following AWS developer centers:
+
+- <http://aws.amazon.com/java/ AWS Java Developer Center>
+- <http://aws.amazon.com/php/ AWS PHP Developer Center>
+- <http://aws.amazon.com/python/ AWS Python Developer Center>
+- <http://aws.amazon.com/ruby/ AWS Ruby Developer Center>
+- <http://aws.amazon.com/net/ AWS Windows and .NET Developer Center>
Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-cloudwatch)
and the [AWS API Reference](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html).
+The types from this library are intended to be used with [amazonka](http://hackage.haskell.org/package/amazonka),
+which provides mechanisms for specifying AuthN/AuthZ information and sending requests.
+
+Use of lenses is required for constructing and manipulating types.
+This is due to the amount of nesting of AWS types and transparency regarding
+de/serialisation into more palatable Haskell values.
+The provided lenses should be compatible with any of the major lens libraries
+[lens](http://hackage.haskell.org/package/lens) or [lens-family-core](http://hackage.haskell.org/package/lens-family-core).
## Contribute
diff --git a/amazonka-cloudwatch.cabal b/amazonka-cloudwatch.cabal
index 1a78284..6a8c219 100644
--- a/amazonka-cloudwatch.cabal
+++ b/amazonka-cloudwatch.cabal
@@ -1,34 +1,82 @@
name: amazonka-cloudwatch
-version: 0.3.6
+version: 1.0.0
synopsis: Amazon CloudWatch SDK.
homepage: https://github.com/brendanhay/amazonka
license: OtherLicense
license-file: LICENSE
author: Brendan Hay
maintainer: Brendan Hay <brendan.g.hay@gmail.com>
-copyright: Copyright (c) 2013-2014 Brendan Hay
+copyright: Copyright (c) 2013-2015 Brendan Hay
category: Network, AWS, Cloud, Distributed Computing
build-type: Simple
extra-source-files: README.md
cabal-version: >= 1.10
description:
- Amazon CloudWatch is a monitoring service for AWS cloud resources and the
- applications you run on AWS. You can use Amazon CloudWatch to collect and
- track metrics, collect and monitor log files, and set alarms. Amazon
- CloudWatch can monitor AWS resources such as Amazon EC2 instances, Amazon
- DynamoDB tables, and Amazon RDS DB instances, as well as custom metrics
- generated by your applications and services, and any log files your
- applications generate. You can use Amazon CloudWatch to gain system-wide
- visibility into resource utilization, application performance, and
- operational health. You can use these insights to react and keep your
- application running smoothly.
+ This is the /Amazon CloudWatch API Reference/. This guide provides
+ detailed information about Amazon CloudWatch actions, data types,
+ parameters, and errors. For detailed information about Amazon CloudWatch
+ features and their associated API calls, go to the
+ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide Amazon CloudWatch Developer Guide>.
+ Amazon CloudWatch is a web service that enables you to publish, monitor,
+ and manage various metrics, as well as configure alarm actions based on
+ data from metrics. For more information about this product go to
+ <http://aws.amazon.com/cloudwatch>.
+
+ For information about the namespace, metric names, and dimensions that
+ other Amazon Web Services products use to send metrics to Cloudwatch, go
+ to
+ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference>
+ in the /Amazon CloudWatch Developer Guide/.
+
+ Use the following links to get started using the /Amazon CloudWatch API
+ Reference/:
+
+ - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Operations.html Actions>:
+ An alphabetical list of all Amazon CloudWatch actions.
+ - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Types.html Data Types>:
+ An alphabetical list of all Amazon CloudWatch data types.
+ - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonParameters.html Common Parameters>:
+ Parameters that all Query actions can use.
+ - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonErrors.html Common Errors>:
+ Client and server errors that all actions can return.
+ - <http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html Regions and Endpoints>:
+ Itemized regions and endpoints for all AWS products.
+ - <http://monitoring.amazonaws.com/doc/2010-08-01/CloudWatch.wsdl WSDL Location>:
+ http:\/\/monitoring.amazonaws.com\/doc\/2010-08-01\/CloudWatch.wsdl
+
+ In addition to using the Amazon CloudWatch API, you can also use the
+ following SDKs and third-party libraries to access Amazon CloudWatch
+ programmatically.
+
+ - <http://aws.amazon.com/documentation/sdkforjava/ AWS SDK for Java Documentation>
+ - <http://aws.amazon.com/documentation/sdkfornet/ AWS SDK for .NET Documentation>
+ - <http://aws.amazon.com/documentation/sdkforphp/ AWS SDK for PHP Documentation>
+ - <http://aws.amazon.com/documentation/sdkforruby/ AWS SDK for Ruby Documentation>
+
+ Developers in the AWS developer community also provide their own
+ libraries, which you can find at the following AWS developer centers:
+
+ - <http://aws.amazon.com/java/ AWS Java Developer Center>
+ - <http://aws.amazon.com/php/ AWS PHP Developer Center>
+ - <http://aws.amazon.com/python/ AWS Python Developer Center>
+ - <http://aws.amazon.com/ruby/ AWS Ruby Developer Center>
+ - <http://aws.amazon.com/net/ AWS Windows and .NET Developer Center>
+ .
+ The types from this library are intended to be used with
+ <http://hackage.haskell.org/package/amazonka amazonka>, which provides
+ mechanisms for specifying AuthN/AuthZ information and sending requests.
.
- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html AWS API Reference>
+ Use of lenses is required for constructing and manipulating types.
+ This is due to the amount of nesting of AWS types and transparency regarding
+ de/serialisation into more palatable Haskell values.
+ The provided lenses should be compatible with any of the major lens libraries
+ such as <http://hackage.haskell.org/package/lens lens> or
+ <http://hackage.haskell.org/package/lens-family-core lens-family-core>.
.
- /Warning:/ This is an experimental preview release which is still under
- heavy development and not intended for public consumption, caveat emptor!
+ See "Network.AWS.CloudWatch" and the <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html AWS API Reference>
+ to get started.
source-repository head
type: git
@@ -54,9 +102,40 @@ library
, Network.AWS.CloudWatch.PutMetricData
, Network.AWS.CloudWatch.SetAlarmState
, Network.AWS.CloudWatch.Types
+ , Network.AWS.CloudWatch.Waiters
other-modules:
+ Network.AWS.CloudWatch.Types.Product
+ , Network.AWS.CloudWatch.Types.Sum
build-depends:
- amazonka-core == 0.3.6.*
+ amazonka-core == 1.0.0.*
, base >= 4.7 && < 5
+
+test-suite amazonka-cloudwatch-test
+ type: exitcode-stdio-1.0
+ default-language: Haskell2010
+ hs-source-dirs: test
+ main-is: Main.hs
+
+ ghc-options: -Wall -threaded
+
+ -- This is not comprehensive if modules have manually been added.
+ -- It exists to ensure cabal 'somewhat' detects test module changes.
+ other-modules:
+ Test.AWS.CloudWatch
+ , Test.AWS.Gen.CloudWatch
+ , Test.AWS.CloudWatch.Internal
+
+ build-depends:
+ amazonka-core == 1.0.0
+ , amazonka-test == 1.0.0
+ , amazonka-cloudwatch == 1.0.0
+ , base
+ , bytestring
+ , lens
+ , tasty
+ , tasty-hunit
+ , text
+ , time
+ , unordered-containers
diff --git a/gen/Network/AWS/CloudWatch.hs b/gen/Network/AWS/CloudWatch.hs
index 86f59ee..757be3f 100644
--- a/gen/Network/AWS/CloudWatch.hs
+++ b/gen/Network/AWS/CloudWatch.hs
@@ -1,49 +1,279 @@
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
+
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Amazon CloudWatch is a monitoring service for AWS cloud resources and the
--- applications you run on AWS. You can use Amazon CloudWatch to collect and
--- track metrics, collect and monitor log files, and set alarms. Amazon
--- CloudWatch can monitor AWS resources such as Amazon EC2 instances, Amazon
--- DynamoDB tables, and Amazon RDS DB instances, as well as custom metrics
--- generated by your applications and services, and any log files your
--- applications generate. You can use Amazon CloudWatch to gain system-wide
--- visibility into resource utilization, application performance, and
--- operational health. You can use these insights to react and keep your
--- application running smoothly.
+-- This is the /Amazon CloudWatch API Reference/. This guide provides
+-- detailed information about Amazon CloudWatch actions, data types,
+-- parameters, and errors. For detailed information about Amazon CloudWatch
+-- features and their associated API calls, go to the
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide Amazon CloudWatch Developer Guide>.
+--
+-- Amazon CloudWatch is a web service that enables you to publish, monitor,
+-- and manage various metrics, as well as configure alarm actions based on
+-- data from metrics. For more information about this product go to
+-- <http://aws.amazon.com/cloudwatch>.
+--
+-- For information about the namespace, metric names, and dimensions that
+-- other Amazon Web Services products use to send metrics to Cloudwatch, go
+-- to
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference>
+-- in the /Amazon CloudWatch Developer Guide/.
+--
+-- Use the following links to get started using the /Amazon CloudWatch API
+-- Reference/:
+--
+-- - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Operations.html Actions>:
+-- An alphabetical list of all Amazon CloudWatch actions.
+-- - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Types.html Data Types>:
+-- An alphabetical list of all Amazon CloudWatch data types.
+-- - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonParameters.html Common Parameters>:
+-- Parameters that all Query actions can use.
+-- - <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CommonErrors.html Common Errors>:
+-- Client and server errors that all actions can return.
+-- - <http://docs.aws.amazon.com/general/latest/gr/index.html?rande.html Regions and Endpoints>:
+-- Itemized regions and endpoints for all AWS products.
+-- - <http://monitoring.amazonaws.com/doc/2010-08-01/CloudWatch.wsdl WSDL Location>:
+-- http:\/\/monitoring.amazonaws.com\/doc\/2010-08-01\/CloudWatch.wsdl
+--
+-- In addition to using the Amazon CloudWatch API, you can also use the
+-- following SDKs and third-party libraries to access Amazon CloudWatch
+-- programmatically.
+--
+-- - <http://aws.amazon.com/documentation/sdkforjava/ AWS SDK for Java Documentation>
+-- - <http://aws.amazon.com/documentation/sdkfornet/ AWS SDK for .NET Documentation>
+-- - <http://aws.amazon.com/documentation/sdkforphp/ AWS SDK for PHP Documentation>
+-- - <http://aws.amazon.com/documentation/sdkforruby/ AWS SDK for Ruby Documentation>
+--
+-- Developers in the AWS developer community also provide their own
+-- libraries, which you can find at the following AWS developer centers:
+--
+-- - <http://aws.amazon.com/java/ AWS Java Developer Center>
+-- - <http://aws.amazon.com/php/ AWS PHP Developer Center>
+-- - <http://aws.amazon.com/python/ AWS Python Developer Center>
+-- - <http://aws.amazon.com/ruby/ AWS Ruby Developer Center>
+-- - <http://aws.amazon.com/net/ AWS Windows and .NET Developer Center>
+--
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html AWS API Reference>
module Network.AWS.CloudWatch
- ( module Network.AWS.CloudWatch.DeleteAlarms
- , module Network.AWS.CloudWatch.DescribeAlarmHistory
- , module Network.AWS.CloudWatch.DescribeAlarms
- , module Network.AWS.CloudWatch.DescribeAlarmsForMetric
- , module Network.AWS.CloudWatch.DisableAlarmActions
+ (
+ -- * Service
+ CloudWatch
+
+ -- * Errors
+ -- $errors
+
+ -- ** LimitExceededFault
+ , _LimitExceededFault
+
+ -- ** InvalidNextToken
+ , _InvalidNextToken
+
+ -- ** InternalServiceFault
+ , _InternalServiceFault
+
+ -- ** InvalidParameterValueException
+ , _InvalidParameterValueException
+
+ -- ** InvalidFormatFault
+ , _InvalidFormatFault
+
+ -- ** MissingRequiredParameterException
+ , _MissingRequiredParameterException
+
+ -- ** InvalidParameterCombinationException
+ , _InvalidParameterCombinationException
+
+ -- ** ResourceNotFound
+ , _ResourceNotFound
+
+ -- * Waiters
+ -- $waiters
+
+ -- * Operations
+ -- $operations
+
+ -- ** EnableAlarmActions
, module Network.AWS.CloudWatch.EnableAlarmActions
- , module Network.AWS.CloudWatch.GetMetricStatistics
- , module Network.AWS.CloudWatch.ListMetrics
- , module Network.AWS.CloudWatch.PutMetricAlarm
+
+ -- ** PutMetricData
, module Network.AWS.CloudWatch.PutMetricData
+
+ -- ** DescribeAlarms (Paginated)
+ , module Network.AWS.CloudWatch.DescribeAlarms
+
+ -- ** ListMetrics (Paginated)
+ , module Network.AWS.CloudWatch.ListMetrics
+
+ -- ** DeleteAlarms
+ , module Network.AWS.CloudWatch.DeleteAlarms
+
+ -- ** DescribeAlarmHistory (Paginated)
+ , module Network.AWS.CloudWatch.DescribeAlarmHistory
+
+ -- ** GetMetricStatistics
+ , module Network.AWS.CloudWatch.GetMetricStatistics
+
+ -- ** DisableAlarmActions
+ , module Network.AWS.CloudWatch.DisableAlarmActions
+
+ -- ** DescribeAlarmsForMetric
+ , module Network.AWS.CloudWatch.DescribeAlarmsForMetric
+
+ -- ** SetAlarmState
, module Network.AWS.CloudWatch.SetAlarmState
- , module Network.AWS.CloudWatch.Types
+
+ -- ** PutMetricAlarm
+ , module Network.AWS.CloudWatch.PutMetricAlarm
+
+ -- * Types
+
+ -- ** ComparisonOperator
+ , ComparisonOperator (..)
+
+ -- ** HistoryItemType
+ , HistoryItemType (..)
+
+ -- ** StandardUnit
+ , StandardUnit (..)
+
+ -- ** StateValue
+ , StateValue (..)
+
+ -- ** Statistic
+ , Statistic (..)
+
+ -- ** AlarmHistoryItem
+ , AlarmHistoryItem
+ , alarmHistoryItem
+ , ahiAlarmName
+ , ahiHistoryItemType
+ , ahiHistoryData
+ , ahiTimestamp
+ , ahiHistorySummary
+
+ -- ** Datapoint
+ , Datapoint
+ , datapoint
+ , dSampleCount
+ , dMaximum
+ , dAverage
+ , dMinimum
+ , dSum
+ , dTimestamp
+ , dUnit
+
+ -- ** Dimension
+ , Dimension
+ , dimension
+ , dName
+ , dValue
+
+ -- ** DimensionFilter
+ , DimensionFilter
+ , dimensionFilter
+ , dfValue
+ , dfName
+
+ -- ** Metric
+ , Metric
+ , metric
+ , mMetricName
+ , mNamespace
+ , mDimensions
+
+ -- ** MetricAlarm
+ , MetricAlarm
+ , metricAlarm
+ , maAlarmName
+ , maStateUpdatedTimestamp
+ , maAlarmDescription
+ , maPeriod
+ , maEvaluationPeriods
+ , maMetricName
+ , maNamespace
+ , maOKActions
+ , maComparisonOperator
+ , maStateValue
+ , maThreshold
+ , maActionsEnabled
+ , maAlarmConfigurationUpdatedTimestamp
+ , maInsufficientDataActions
+ , maDimensions
+ , maStateReasonData
+ , maStateReason
+ , maAlarmARN
+ , maAlarmActions
+ , maStatistic
+ , maUnit
+
+ -- ** MetricDatum
+ , MetricDatum
+ , metricDatum
+ , mdValue
+ , mdDimensions
+ , mdTimestamp
+ , mdStatisticValues
+ , mdUnit
+ , mdMetricName
+
+ -- ** StatisticSet
+ , StatisticSet
+ , statisticSet
+ , ssSampleCount
+ , ssSum
+ , ssMinimum
+ , ssMaximum
) where
-import Network.AWS.CloudWatch.DeleteAlarms
-import Network.AWS.CloudWatch.DescribeAlarmHistory
-import Network.AWS.CloudWatch.DescribeAlarms
-import Network.AWS.CloudWatch.DescribeAlarmsForMetric
-import Network.AWS.CloudWatch.DisableAlarmActions
-import Network.AWS.CloudWatch.EnableAlarmActions
-import Network.AWS.CloudWatch.GetMetricStatistics
-import Network.AWS.CloudWatch.ListMetrics
-import Network.AWS.CloudWatch.PutMetricAlarm
-import Network.AWS.CloudWatch.PutMetricData
-import Network.AWS.CloudWatch.SetAlarmState
-import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.DeleteAlarms
+import Network.AWS.CloudWatch.DescribeAlarmHistory
+import Network.AWS.CloudWatch.DescribeAlarms
+import Network.AWS.CloudWatch.DescribeAlarmsForMetric
+import Network.AWS.CloudWatch.DisableAlarmActions
+import Network.AWS.CloudWatch.EnableAlarmActions
+import Network.AWS.CloudWatch.GetMetricStatistics
+import Network.AWS.CloudWatch.ListMetrics
+import Network.AWS.CloudWatch.PutMetricAlarm
+import Network.AWS.CloudWatch.PutMetricData
+import Network.AWS.CloudWatch.SetAlarmState
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Waiters
+
+{- $errors
+Error matchers are designed for use with the functions provided by
+<http://hackage.haskell.org/package/lens/docs/Control-Exception-Lens.html Control.Exception.Lens>.
+This allows catching (and rethrowing) service specific errors returned
+by 'CloudWatch'.
+-}
+
+{- $operations
+Some AWS operations return results that are incomplete and require subsequent
+requests in order to obtain the entire result set. The process of sending
+subsequent requests to continue where a previous request left off is called
+pagination. For example, the 'ListObjects' operation of Amazon S3 returns up to
+1000 objects at a time, and you must send subsequent requests with the
+appropriate Marker in order to retrieve the next page of results.
+
+Operations that have an 'AWSPager' instance can transparently perform subsequent
+requests, correctly setting Markers and other request facets to iterate through
+the entire result set of a truncated API operation. Operations which support
+this have an additional note in the documentation.
+
+Many operations have the ability to filter results on the server side. See the
+individual operation parameters for details.
+-}
+
+{- $waiters
+Waiters poll by repeatedly sending a request until some remote success condition
+configured by the 'Wait' specification is fulfilled. The 'Wait' specification
+determines how many attempts should be made, in addition to delay and retry strategies.
+-}
diff --git a/gen/Network/AWS/CloudWatch/DeleteAlarms.hs b/gen/Network/AWS/CloudWatch/DeleteAlarms.hs
index b935d18..10dc4f2 100644
--- a/gen/Network/AWS/CloudWatch/DeleteAlarms.hs
+++ b/gen/Network/AWS/CloudWatch/DeleteAlarms.hs
@@ -1,96 +1,93 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.DeleteAlarms
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Deletes all specified alarms. In the event of an error, no alarms are
+-- Deletes all specified alarms. In the event of an error, no alarms are
-- deleted.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DeleteAlarms.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DeleteAlarms.html AWS API Reference> for DeleteAlarms.
module Network.AWS.CloudWatch.DeleteAlarms
(
- -- * Request
- DeleteAlarms
- -- ** Request constructor
- , deleteAlarms
- -- ** Request lenses
- , da1AlarmNames
+ -- * Creating a Request
+ deleteAlarms
+ , DeleteAlarms
+ -- * Request Lenses
+ , dAlarmNames
- -- * Response
- , DeleteAlarmsResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, deleteAlarmsResponse
+ , DeleteAlarmsResponse
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-newtype DeleteAlarms = DeleteAlarms
- { _da1AlarmNames :: List "member" Text
- } deriving (Eq, Ord, Read, Show, Monoid, Semigroup)
-
-instance GHC.Exts.IsList DeleteAlarms where
- type Item DeleteAlarms = Text
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
- fromList = DeleteAlarms . GHC.Exts.fromList
- toList = GHC.Exts.toList . _da1AlarmNames
+-- | /See:/ 'deleteAlarms' smart constructor.
+newtype DeleteAlarms = DeleteAlarms'
+ { _dAlarmNames :: [Text]
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
--- | 'DeleteAlarms' constructor.
+-- | Creates a value of 'DeleteAlarms' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'da1AlarmNames' @::@ ['Text']
---
-deleteAlarms :: DeleteAlarms
-deleteAlarms = DeleteAlarms
- { _da1AlarmNames = mempty
+-- * 'dAlarmNames'
+deleteAlarms
+ :: DeleteAlarms
+deleteAlarms =
+ DeleteAlarms'
+ { _dAlarmNames = mempty
}
-- | A list of alarms to be deleted.
-da1AlarmNames :: Lens' DeleteAlarms [Text]
-da1AlarmNames = lens _da1AlarmNames (\s a -> s { _da1AlarmNames = a }) . _List
+dAlarmNames :: Lens' DeleteAlarms [Text]
+dAlarmNames = lens _dAlarmNames (\ s a -> s{_dAlarmNames = a}) . _Coerce;
-data DeleteAlarmsResponse = DeleteAlarmsResponse
- deriving (Eq, Ord, Read, Show, Generic)
+instance AWSRequest DeleteAlarms where
+ type Sv DeleteAlarms = CloudWatch
+ type Rs DeleteAlarms = DeleteAlarmsResponse
+ request = postQuery
+ response = receiveNull DeleteAlarmsResponse'
--- | 'DeleteAlarmsResponse' constructor.
-deleteAlarmsResponse :: DeleteAlarmsResponse
-deleteAlarmsResponse = DeleteAlarmsResponse
+instance ToHeaders DeleteAlarms where
+ toHeaders = const mempty
instance ToPath DeleteAlarms where
- toPath = const "/"
+ toPath = const "/"
instance ToQuery DeleteAlarms where
- toQuery DeleteAlarms{..} = mconcat
- [ "AlarmNames" =? _da1AlarmNames
- ]
-
-instance ToHeaders DeleteAlarms
-
-instance AWSRequest DeleteAlarms where
- type Sv DeleteAlarms = CloudWatch
- type Rs DeleteAlarms = DeleteAlarmsResponse
-
- request = post "DeleteAlarms"
- response = nullResponse DeleteAlarmsResponse
+ toQuery DeleteAlarms'{..}
+ = mconcat
+ ["Action" =: ("DeleteAlarms" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "AlarmNames" =: toQueryList "member" _dAlarmNames]
+
+-- | /See:/ 'deleteAlarmsResponse' smart constructor.
+data DeleteAlarmsResponse =
+ DeleteAlarmsResponse'
+ deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DeleteAlarmsResponse' with the minimum fields required to make a request.
+--
+deleteAlarmsResponse
+ :: DeleteAlarmsResponse
+deleteAlarmsResponse = DeleteAlarmsResponse'
diff --git a/gen/Network/AWS/CloudWatch/DescribeAlarmHistory.hs b/gen/Network/AWS/CloudWatch/DescribeAlarmHistory.hs
index 13ff4fd..294aee4 100644
--- a/gen/Network/AWS/CloudWatch/DescribeAlarmHistory.hs
+++ b/gen/Network/AWS/CloudWatch/DescribeAlarmHistory.hs
@@ -1,179 +1,196 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.DescribeAlarmHistory
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Retrieves history for the specified alarm. Filter alarms by date range or
--- item type. If an alarm name is not specified, Amazon CloudWatch returns
--- histories for all of the owner's alarms.
+-- Retrieves history for the specified alarm. Filter alarms by date range
+-- or item type. If an alarm name is not specified, Amazon CloudWatch
+-- returns histories for all of the owner\'s alarms.
+--
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html AWS API Reference> for DescribeAlarmHistory.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html>
+-- This operation returns paginated results.
module Network.AWS.CloudWatch.DescribeAlarmHistory
(
- -- * Request
- DescribeAlarmHistory
- -- ** Request constructor
- , describeAlarmHistory
- -- ** Request lenses
+ -- * Creating a Request
+ describeAlarmHistory
+ , DescribeAlarmHistory
+ -- * Request Lenses
, dahAlarmName
- , dahEndDate
, dahHistoryItemType
- , dahMaxRecords
- , dahNextToken
+ , dahEndDate
, dahStartDate
+ , dahNextToken
+ , dahMaxRecords
- -- * Response
- , DescribeAlarmHistoryResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, describeAlarmHistoryResponse
- -- ** Response lenses
- , dahrAlarmHistoryItems
- , dahrNextToken
+ , DescribeAlarmHistoryResponse
+ -- * Response Lenses
+ , dahrsAlarmHistoryItems
+ , dahrsNextToken
+ , dahrsStatus
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-data DescribeAlarmHistory = DescribeAlarmHistory
- { _dahAlarmName :: Maybe Text
- , _dahEndDate :: Maybe ISO8601
- , _dahHistoryItemType :: Maybe HistoryItemType
- , _dahMaxRecords :: Maybe Nat
- , _dahNextToken :: Maybe Text
- , _dahStartDate :: Maybe ISO8601
- } deriving (Eq, Read, Show)
-
--- | 'DescribeAlarmHistory' constructor.
---
--- The fields accessible through corresponding lenses are:
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Pager
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
+
+-- | /See:/ 'describeAlarmHistory' smart constructor.
+data DescribeAlarmHistory = DescribeAlarmHistory'
+ { _dahAlarmName :: !(Maybe Text)
+ , _dahHistoryItemType :: !(Maybe HistoryItemType)
+ , _dahEndDate :: !(Maybe ISO8601)
+ , _dahStartDate :: !(Maybe ISO8601)
+ , _dahNextToken :: !(Maybe Text)
+ , _dahMaxRecords :: !(Maybe Nat)
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DescribeAlarmHistory' with the minimum fields required to make a request.
--
--- * 'dahAlarmName' @::@ 'Maybe' 'Text'
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'dahEndDate' @::@ 'Maybe' 'UTCTime'
+-- * 'dahAlarmName'
--
--- * 'dahHistoryItemType' @::@ 'Maybe' 'HistoryItemType'
+-- * 'dahHistoryItemType'
--
--- * 'dahMaxRecords' @::@ 'Maybe' 'Natural'
+-- * 'dahEndDate'
--
--- * 'dahNextToken' @::@ 'Maybe' 'Text'
+-- * 'dahStartDate'
--
--- * 'dahStartDate' @::@ 'Maybe' 'UTCTime'
+-- * 'dahNextToken'
--
-describeAlarmHistory :: DescribeAlarmHistory
-describeAlarmHistory = DescribeAlarmHistory
- { _dahAlarmName = Nothing
+-- * 'dahMaxRecords'
+describeAlarmHistory
+ :: DescribeAlarmHistory
+describeAlarmHistory =
+ DescribeAlarmHistory'
+ { _dahAlarmName = Nothing
, _dahHistoryItemType = Nothing
- , _dahStartDate = Nothing
- , _dahEndDate = Nothing
- , _dahMaxRecords = Nothing
- , _dahNextToken = Nothing
+ , _dahEndDate = Nothing
+ , _dahStartDate = Nothing
+ , _dahNextToken = Nothing
+ , _dahMaxRecords = Nothing
}
-- | The name of the alarm.
dahAlarmName :: Lens' DescribeAlarmHistory (Maybe Text)
-dahAlarmName = lens _dahAlarmName (\s a -> s { _dahAlarmName = a })
+dahAlarmName = lens _dahAlarmName (\ s a -> s{_dahAlarmName = a});
+
+-- | The type of alarm histories to retrieve.
+dahHistoryItemType :: Lens' DescribeAlarmHistory (Maybe HistoryItemType)
+dahHistoryItemType = lens _dahHistoryItemType (\ s a -> s{_dahHistoryItemType = a});
-- | The ending date to retrieve alarm history.
dahEndDate :: Lens' DescribeAlarmHistory (Maybe UTCTime)
-dahEndDate = lens _dahEndDate (\s a -> s { _dahEndDate = a }) . mapping _Time
+dahEndDate = lens _dahEndDate (\ s a -> s{_dahEndDate = a}) . mapping _Time;
--- | The type of alarm histories to retrieve.
-dahHistoryItemType :: Lens' DescribeAlarmHistory (Maybe HistoryItemType)
-dahHistoryItemType =
- lens _dahHistoryItemType (\s a -> s { _dahHistoryItemType = a })
+-- | The starting date to retrieve alarm history.
+dahStartDate :: Lens' DescribeAlarmHistory (Maybe UTCTime)
+dahStartDate = lens _dahStartDate (\ s a -> s{_dahStartDate = a}) . mapping _Time;
+
+-- | The token returned by a previous call to indicate that there is more
+-- data available.
+dahNextToken :: Lens' DescribeAlarmHistory (Maybe Text)
+dahNextToken = lens _dahNextToken (\ s a -> s{_dahNextToken = a});
-- | The maximum number of alarm history records to retrieve.
dahMaxRecords :: Lens' DescribeAlarmHistory (Maybe Natural)
-dahMaxRecords = lens _dahMaxRecords (\s a -> s { _dahMaxRecords = a }) . mapping _Nat
+dahMaxRecords = lens _dahMaxRecords (\ s a -> s{_dahMaxRecords = a}) . mapping _Nat;
--- | The token returned by a previous call to indicate that there is more data
--- available.
-dahNextToken :: Lens' DescribeAlarmHistory (Maybe Text)
-dahNextToken = lens _dahNextToken (\s a -> s { _dahNextToken = a })
+instance AWSPager DescribeAlarmHistory where
+ page rq rs
+ | stop (rs ^. dahrsNextToken) = Nothing
+ | stop (rs ^. dahrsAlarmHistoryItems) = Nothing
+ | otherwise =
+ Just $ rq & dahNextToken .~ rs ^. dahrsNextToken
--- | The starting date to retrieve alarm history.
-dahStartDate :: Lens' DescribeAlarmHistory (Maybe UTCTime)
-dahStartDate = lens _dahStartDate (\s a -> s { _dahStartDate = a }) . mapping _Time
+instance AWSRequest DescribeAlarmHistory where
+ type Sv DescribeAlarmHistory = CloudWatch
+ type Rs DescribeAlarmHistory =
+ DescribeAlarmHistoryResponse
+ request = postQuery
+ response
+ = receiveXMLWrapper "DescribeAlarmHistoryResult"
+ (\ s h x ->
+ DescribeAlarmHistoryResponse' <$>
+ (x .@? "AlarmHistoryItems" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "NextToken")
+ <*> (pure (fromEnum s)))
+
+instance ToHeaders DescribeAlarmHistory where
+ toHeaders = const mempty
-data DescribeAlarmHistoryResponse = DescribeAlarmHistoryResponse
- { _dahrAlarmHistoryItems :: List "member" AlarmHistoryItem
- , _dahrNextToken :: Maybe Text
- } deriving (Eq, Read, Show)
+instance ToPath DescribeAlarmHistory where
+ toPath = const "/"
--- | 'DescribeAlarmHistoryResponse' constructor.
+instance ToQuery DescribeAlarmHistory where
+ toQuery DescribeAlarmHistory'{..}
+ = mconcat
+ ["Action" =: ("DescribeAlarmHistory" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "AlarmName" =: _dahAlarmName,
+ "HistoryItemType" =: _dahHistoryItemType,
+ "EndDate" =: _dahEndDate,
+ "StartDate" =: _dahStartDate,
+ "NextToken" =: _dahNextToken,
+ "MaxRecords" =: _dahMaxRecords]
+
+-- | The output for the DescribeAlarmHistory action.
+--
+-- /See:/ 'describeAlarmHistoryResponse' smart constructor.
+data DescribeAlarmHistoryResponse = DescribeAlarmHistoryResponse'
+ { _dahrsAlarmHistoryItems :: !(Maybe [AlarmHistoryItem])
+ , _dahrsNextToken :: !(Maybe Text)
+ , _dahrsStatus :: !Int
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DescribeAlarmHistoryResponse' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'dahrAlarmHistoryItems' @::@ ['AlarmHistoryItem']
+-- * 'dahrsAlarmHistoryItems'
--
--- * 'dahrNextToken' @::@ 'Maybe' 'Text'
+-- * 'dahrsNextToken'
--
-describeAlarmHistoryResponse :: DescribeAlarmHistoryResponse
-describeAlarmHistoryResponse = DescribeAlarmHistoryResponse
- { _dahrAlarmHistoryItems = mempty
- , _dahrNextToken = Nothing
+-- * 'dahrsStatus'
+describeAlarmHistoryResponse
+ :: Int -- ^ 'dahrsStatus'
+ -> DescribeAlarmHistoryResponse
+describeAlarmHistoryResponse pStatus_ =
+ DescribeAlarmHistoryResponse'
+ { _dahrsAlarmHistoryItems = Nothing
+ , _dahrsNextToken = Nothing
+ , _dahrsStatus = pStatus_
}
-- | A list of alarm histories in JSON format.
-dahrAlarmHistoryItems :: Lens' DescribeAlarmHistoryResponse [AlarmHistoryItem]
-dahrAlarmHistoryItems =
- lens _dahrAlarmHistoryItems (\s a -> s { _dahrAlarmHistoryItems = a })
- . _List
+dahrsAlarmHistoryItems :: Lens' DescribeAlarmHistoryResponse [AlarmHistoryItem]
+dahrsAlarmHistoryItems = lens _dahrsAlarmHistoryItems (\ s a -> s{_dahrsAlarmHistoryItems = a}) . _Default . _Coerce;
-- | A string that marks the start of the next batch of returned results.
-dahrNextToken :: Lens' DescribeAlarmHistoryResponse (Maybe Text)
-dahrNextToken = lens _dahrNextToken (\s a -> s { _dahrNextToken = a })
+dahrsNextToken :: Lens' DescribeAlarmHistoryResponse (Maybe Text)
+dahrsNextToken = lens _dahrsNextToken (\ s a -> s{_dahrsNextToken = a});
-instance ToPath DescribeAlarmHistory where
- toPath = const "/"
-
-instance ToQuery DescribeAlarmHistory where
- toQuery DescribeAlarmHistory{..} = mconcat
- [ "AlarmName" =? _dahAlarmName
- , "EndDate" =? _dahEndDate
- , "HistoryItemType" =? _dahHistoryItemType
- , "MaxRecords" =? _dahMaxRecords
- , "NextToken" =? _dahNextToken
- , "StartDate" =? _dahStartDate
- ]
-
-instance ToHeaders DescribeAlarmHistory
-
-instance AWSRequest DescribeAlarmHistory where
- type Sv DescribeAlarmHistory = CloudWatch
- type Rs DescribeAlarmHistory = DescribeAlarmHistoryResponse
-
- request = post "DescribeAlarmHistory"
- response = xmlResponse
-
-instance FromXML DescribeAlarmHistoryResponse where
- parseXML = withElement "DescribeAlarmHistoryResult" $ \x -> DescribeAlarmHistoryResponse
- <$> x .@? "AlarmHistoryItems" .!@ mempty
- <*> x .@? "NextToken"
-
-instance AWSPager DescribeAlarmHistory where
- page rq rs
- | stop (rs ^. dahrNextToken) = Nothing
- | otherwise = (\x -> rq & dahNextToken ?~ x)
- <$> (rs ^. dahrNextToken)
+-- | The response status code.
+dahrsStatus :: Lens' DescribeAlarmHistoryResponse Int
+dahrsStatus = lens _dahrsStatus (\ s a -> s{_dahrsStatus = a});
diff --git a/gen/Network/AWS/CloudWatch/DescribeAlarms.hs b/gen/Network/AWS/CloudWatch/DescribeAlarms.hs
index 1149728..1fc98f6 100644
--- a/gen/Network/AWS/CloudWatch/DescribeAlarms.hs
+++ b/gen/Network/AWS/CloudWatch/DescribeAlarms.hs
@@ -1,178 +1,198 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.DescribeAlarms
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Retrieves alarms with the specified names. If no name is specified, all
--- alarms for the user are returned. Alarms can be retrieved by using only a
--- prefix for the alarm name, the alarm state, or a prefix for any action.
+-- Retrieves alarms with the specified names. If no name is specified, all
+-- alarms for the user are returned. Alarms can be retrieved by using only
+-- a prefix for the alarm name, the alarm state, or a prefix for any
+-- action.
+--
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html AWS API Reference> for DescribeAlarms.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html>
+-- This operation returns paginated results.
module Network.AWS.CloudWatch.DescribeAlarms
(
- -- * Request
- DescribeAlarms
- -- ** Request constructor
- , describeAlarms
- -- ** Request lenses
- , daActionPrefix
+ -- * Creating a Request
+ describeAlarms
+ , DescribeAlarms
+ -- * Request Lenses
, daAlarmNamePrefix
- , daAlarmNames
- , daMaxRecords
+ , daActionPrefix
, daNextToken
, daStateValue
+ , daAlarmNames
+ , daMaxRecords
- -- * Response
- , DescribeAlarmsResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, describeAlarmsResponse
- -- ** Response lenses
- , darMetricAlarms
- , darNextToken
+ , DescribeAlarmsResponse
+ -- * Response Lenses
+ , darsMetricAlarms
+ , darsNextToken
+ , darsStatus
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-data DescribeAlarms = DescribeAlarms
- { _daActionPrefix :: Maybe Text
- , _daAlarmNamePrefix :: Maybe Text
- , _daAlarmNames :: List "member" Text
- , _daMaxRecords :: Maybe Nat
- , _daNextToken :: Maybe Text
- , _daStateValue :: Maybe StateValue
- } deriving (Eq, Read, Show)
-
--- | 'DescribeAlarms' constructor.
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Pager
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
+
+-- | /See:/ 'describeAlarms' smart constructor.
+data DescribeAlarms = DescribeAlarms'
+ { _daAlarmNamePrefix :: !(Maybe Text)
+ , _daActionPrefix :: !(Maybe Text)
+ , _daNextToken :: !(Maybe Text)
+ , _daStateValue :: !(Maybe StateValue)
+ , _daAlarmNames :: !(Maybe [Text])
+ , _daMaxRecords :: !(Maybe Nat)
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DescribeAlarms' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'daActionPrefix' @::@ 'Maybe' 'Text'
+-- * 'daAlarmNamePrefix'
--
--- * 'daAlarmNamePrefix' @::@ 'Maybe' 'Text'
+-- * 'daActionPrefix'
--
--- * 'daAlarmNames' @::@ ['Text']
+-- * 'daNextToken'
--
--- * 'daMaxRecords' @::@ 'Maybe' 'Natural'
+-- * 'daStateValue'
--
--- * 'daNextToken' @::@ 'Maybe' 'Text'
+-- * 'daAlarmNames'
--
--- * 'daStateValue' @::@ 'Maybe' 'StateValue'
---
-describeAlarms :: DescribeAlarms
-describeAlarms = DescribeAlarms
- { _daAlarmNames = mempty
- , _daAlarmNamePrefix = Nothing
- , _daStateValue = Nothing
- , _daActionPrefix = Nothing
- , _daMaxRecords = Nothing
- , _daNextToken = Nothing
+-- * 'daMaxRecords'
+describeAlarms
+ :: DescribeAlarms
+describeAlarms =
+ DescribeAlarms'
+ { _daAlarmNamePrefix = Nothing
+ , _daActionPrefix = Nothing
+ , _daNextToken = Nothing
+ , _daStateValue = Nothing
+ , _daAlarmNames = Nothing
+ , _daMaxRecords = Nothing
}
+-- | The alarm name prefix. 'AlarmNames' cannot be specified if this
+-- parameter is specified.
+daAlarmNamePrefix :: Lens' DescribeAlarms (Maybe Text)
+daAlarmNamePrefix = lens _daAlarmNamePrefix (\ s a -> s{_daAlarmNamePrefix = a});
+
-- | The action name prefix.
daActionPrefix :: Lens' DescribeAlarms (Maybe Text)
-daActionPrefix = lens _daActionPrefix (\s a -> s { _daActionPrefix = a })
+daActionPrefix = lens _daActionPrefix (\ s a -> s{_daActionPrefix = a});
--- | The alarm name prefix. 'AlarmNames' cannot be specified if this parameter is
--- specified.
-daAlarmNamePrefix :: Lens' DescribeAlarms (Maybe Text)
-daAlarmNamePrefix =
- lens _daAlarmNamePrefix (\s a -> s { _daAlarmNamePrefix = a })
+-- | The token returned by a previous call to indicate that there is more
+-- data available.
+daNextToken :: Lens' DescribeAlarms (Maybe Text)
+daNextToken = lens _daNextToken (\ s a -> s{_daNextToken = a});
+
+-- | The state value to be used in matching alarms.
+daStateValue :: Lens' DescribeAlarms (Maybe StateValue)
+daStateValue = lens _daStateValue (\ s a -> s{_daStateValue = a});
-- | A list of alarm names to retrieve information for.
daAlarmNames :: Lens' DescribeAlarms [Text]
-daAlarmNames = lens _daAlarmNames (\s a -> s { _daAlarmNames = a }) . _List
+daAlarmNames = lens _daAlarmNames (\ s a -> s{_daAlarmNames = a}) . _Default . _Coerce;
-- | The maximum number of alarm descriptions to retrieve.
daMaxRecords :: Lens' DescribeAlarms (Maybe Natural)
-daMaxRecords = lens _daMaxRecords (\s a -> s { _daMaxRecords = a }) . mapping _Nat
+daMaxRecords = lens _daMaxRecords (\ s a -> s{_daMaxRecords = a}) . mapping _Nat;
--- | The token returned by a previous call to indicate that there is more data
--- available.
-daNextToken :: Lens' DescribeAlarms (Maybe Text)
-daNextToken = lens _daNextToken (\s a -> s { _daNextToken = a })
+instance AWSPager DescribeAlarms where
+ page rq rs
+ | stop (rs ^. darsNextToken) = Nothing
+ | stop (rs ^. darsMetricAlarms) = Nothing
+ | otherwise =
+ Just $ rq & daNextToken .~ rs ^. darsNextToken
--- | The state value to be used in matching alarms.
-daStateValue :: Lens' DescribeAlarms (Maybe StateValue)
-daStateValue = lens _daStateValue (\s a -> s { _daStateValue = a })
+instance AWSRequest DescribeAlarms where
+ type Sv DescribeAlarms = CloudWatch
+ type Rs DescribeAlarms = DescribeAlarmsResponse
+ request = postQuery
+ response
+ = receiveXMLWrapper "DescribeAlarmsResult"
+ (\ s h x ->
+ DescribeAlarmsResponse' <$>
+ (x .@? "MetricAlarms" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "NextToken")
+ <*> (pure (fromEnum s)))
+
+instance ToHeaders DescribeAlarms where
+ toHeaders = const mempty
-data DescribeAlarmsResponse = DescribeAlarmsResponse
- { _darMetricAlarms :: List "member" MetricAlarm
- , _darNextToken :: Maybe Text
- } deriving (Eq, Read, Show)
+instance ToPath DescribeAlarms where
+ toPath = const "/"
--- | 'DescribeAlarmsResponse' constructor.
+instance ToQuery DescribeAlarms where
+ toQuery DescribeAlarms'{..}
+ = mconcat
+ ["Action" =: ("DescribeAlarms" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "AlarmNamePrefix" =: _daAlarmNamePrefix,
+ "ActionPrefix" =: _daActionPrefix,
+ "NextToken" =: _daNextToken,
+ "StateValue" =: _daStateValue,
+ "AlarmNames" =:
+ toQuery (toQueryList "member" <$> _daAlarmNames),
+ "MaxRecords" =: _daMaxRecords]
+
+-- | The output for the DescribeAlarms action.
--
--- The fields accessible through corresponding lenses are:
+-- /See:/ 'describeAlarmsResponse' smart constructor.
+data DescribeAlarmsResponse = DescribeAlarmsResponse'
+ { _darsMetricAlarms :: !(Maybe [MetricAlarm])
+ , _darsNextToken :: !(Maybe Text)
+ , _darsStatus :: !Int
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DescribeAlarmsResponse' with the minimum fields required to make a request.
--
--- * 'darMetricAlarms' @::@ ['MetricAlarm']
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'darNextToken' @::@ 'Maybe' 'Text'
+-- * 'darsMetricAlarms'
--
-describeAlarmsResponse :: DescribeAlarmsResponse
-describeAlarmsResponse = DescribeAlarmsResponse
- { _darMetricAlarms = mempty
- , _darNextToken = Nothing
+-- * 'darsNextToken'
+--
+-- * 'darsStatus'
+describeAlarmsResponse
+ :: Int -- ^ 'darsStatus'
+ -> DescribeAlarmsResponse
+describeAlarmsResponse pStatus_ =
+ DescribeAlarmsResponse'
+ { _darsMetricAlarms = Nothing
+ , _darsNextToken = Nothing
+ , _darsStatus = pStatus_
}
-- | A list of information for the specified alarms.
-darMetricAlarms :: Lens' DescribeAlarmsResponse [MetricAlarm]
-darMetricAlarms = lens _darMetricAlarms (\s a -> s { _darMetricAlarms = a }) . _List
+darsMetricAlarms :: Lens' DescribeAlarmsResponse [MetricAlarm]
+darsMetricAlarms = lens _darsMetricAlarms (\ s a -> s{_darsMetricAlarms = a}) . _Default . _Coerce;
-- | A string that marks the start of the next batch of returned results.
-darNextToken :: Lens' DescribeAlarmsResponse (Maybe Text)
-darNextToken = lens _darNextToken (\s a -> s { _darNextToken = a })
+darsNextToken :: Lens' DescribeAlarmsResponse (Maybe Text)
+darsNextToken = lens _darsNextToken (\ s a -> s{_darsNextToken = a});
-instance ToPath DescribeAlarms where
- toPath = const "/"
-
-instance ToQuery DescribeAlarms where
- toQuery DescribeAlarms{..} = mconcat
- [ "ActionPrefix" =? _daActionPrefix
- , "AlarmNamePrefix" =? _daAlarmNamePrefix
- , "AlarmNames" =? _daAlarmNames
- , "MaxRecords" =? _daMaxRecords
- , "NextToken" =? _daNextToken
- , "StateValue" =? _daStateValue
- ]
-
-instance ToHeaders DescribeAlarms
-
-instance AWSRequest DescribeAlarms where
- type Sv DescribeAlarms = CloudWatch
- type Rs DescribeAlarms = DescribeAlarmsResponse
-
- request = post "DescribeAlarms"
- response = xmlResponse
-
-instance FromXML DescribeAlarmsResponse where
- parseXML = withElement "DescribeAlarmsResult" $ \x -> DescribeAlarmsResponse
- <$> x .@? "MetricAlarms" .!@ mempty
- <*> x .@? "NextToken"
-
-instance AWSPager DescribeAlarms where
- page rq rs
- | stop (rs ^. darNextToken) = Nothing
- | otherwise = (\x -> rq & daNextToken ?~ x)
- <$> (rs ^. darNextToken)
+-- | The response status code.
+darsStatus :: Lens' DescribeAlarmsResponse Int
+darsStatus = lens _darsStatus (\ s a -> s{_darsStatus = a});
diff --git a/gen/Network/AWS/CloudWatch/DescribeAlarmsForMetric.hs b/gen/Network/AWS/CloudWatch/DescribeAlarmsForMetric.hs
index de924f9..a11d5fc 100644
--- a/gen/Network/AWS/CloudWatch/DescribeAlarmsForMetric.hs
+++ b/gen/Network/AWS/CloudWatch/DescribeAlarmsForMetric.hs
@@ -1,168 +1,177 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.DescribeAlarmsForMetric
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Retrieves all alarms for a single metric. Specify a statistic, period, or
--- unit to filter the set of alarms further.
+-- Retrieves all alarms for a single metric. Specify a statistic, period,
+-- or unit to filter the set of alarms further.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmsForMetric.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmsForMetric.html AWS API Reference> for DescribeAlarmsForMetric.
module Network.AWS.CloudWatch.DescribeAlarmsForMetric
(
- -- * Request
- DescribeAlarmsForMetric
- -- ** Request constructor
- , describeAlarmsForMetric
- -- ** Request lenses
- , dafmDimensions
- , dafmMetricName
- , dafmNamespace
+ -- * Creating a Request
+ describeAlarmsForMetric
+ , DescribeAlarmsForMetric
+ -- * Request Lenses
, dafmPeriod
+ , dafmDimensions
, dafmStatistic
, dafmUnit
+ , dafmMetricName
+ , dafmNamespace
- -- * Response
- , DescribeAlarmsForMetricResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, describeAlarmsForMetricResponse
- -- ** Response lenses
- , dafmrMetricAlarms
+ , DescribeAlarmsForMetricResponse
+ -- * Response Lenses
+ , dafmrsMetricAlarms
+ , dafmrsStatus
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-data DescribeAlarmsForMetric = DescribeAlarmsForMetric
- { _dafmDimensions :: List "member" Dimension
- , _dafmMetricName :: Text
- , _dafmNamespace :: Text
- , _dafmPeriod :: Maybe Nat
- , _dafmStatistic :: Maybe Statistic
- , _dafmUnit :: Maybe StandardUnit
- } deriving (Eq, Read, Show)
-
--- | 'DescribeAlarmsForMetric' constructor.
---
--- The fields accessible through corresponding lenses are:
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
+
+-- | /See:/ 'describeAlarmsForMetric' smart constructor.
+data DescribeAlarmsForMetric = DescribeAlarmsForMetric'
+ { _dafmPeriod :: !(Maybe Nat)
+ , _dafmDimensions :: !(Maybe [Dimension])
+ , _dafmStatistic :: !(Maybe Statistic)
+ , _dafmUnit :: !(Maybe StandardUnit)
+ , _dafmMetricName :: !Text
+ , _dafmNamespace :: !Text
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DescribeAlarmsForMetric' with the minimum fields required to make a request.
--
--- * 'dafmDimensions' @::@ ['Dimension']
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'dafmMetricName' @::@ 'Text'
+-- * 'dafmPeriod'
--
--- * 'dafmNamespace' @::@ 'Text'
+-- * 'dafmDimensions'
--
--- * 'dafmPeriod' @::@ 'Maybe' 'Natural'
+-- * 'dafmStatistic'
--
--- * 'dafmStatistic' @::@ 'Maybe' 'Statistic'
+-- * 'dafmUnit'
--
--- * 'dafmUnit' @::@ 'Maybe' 'StandardUnit'
+-- * 'dafmMetricName'
--
-describeAlarmsForMetric :: Text -- ^ 'dafmMetricName'
- -> Text -- ^ 'dafmNamespace'
- -> DescribeAlarmsForMetric
-describeAlarmsForMetric p1 p2 = DescribeAlarmsForMetric
- { _dafmMetricName = p1
- , _dafmNamespace = p2
- , _dafmStatistic = Nothing
- , _dafmDimensions = mempty
- , _dafmPeriod = Nothing
- , _dafmUnit = Nothing
+-- * 'dafmNamespace'
+describeAlarmsForMetric
+ :: Text -- ^ 'dafmMetricName'
+ -> Text -- ^ 'dafmNamespace'
+ -> DescribeAlarmsForMetric
+describeAlarmsForMetric pMetricName_ pNamespace_ =
+ DescribeAlarmsForMetric'
+ { _dafmPeriod = Nothing
+ , _dafmDimensions = Nothing
+ , _dafmStatistic = Nothing
+ , _dafmUnit = Nothing
+ , _dafmMetricName = pMetricName_
+ , _dafmNamespace = pNamespace_
}
--- | The list of dimensions associated with the metric.
-dafmDimensions :: Lens' DescribeAlarmsForMetric [Dimension]
-dafmDimensions = lens _dafmDimensions (\s a -> s { _dafmDimensions = a }) . _List
-
--- | The name of the metric.
-dafmMetricName :: Lens' DescribeAlarmsForMetric Text
-dafmMetricName = lens _dafmMetricName (\s a -> s { _dafmMetricName = a })
-
--- | The namespace of the metric.
-dafmNamespace :: Lens' DescribeAlarmsForMetric Text
-dafmNamespace = lens _dafmNamespace (\s a -> s { _dafmNamespace = a })
-
-- | The period in seconds over which the statistic is applied.
dafmPeriod :: Lens' DescribeAlarmsForMetric (Maybe Natural)
-dafmPeriod = lens _dafmPeriod (\s a -> s { _dafmPeriod = a }) . mapping _Nat
+dafmPeriod = lens _dafmPeriod (\ s a -> s{_dafmPeriod = a}) . mapping _Nat;
+
+-- | The list of dimensions associated with the metric.
+dafmDimensions :: Lens' DescribeAlarmsForMetric [Dimension]
+dafmDimensions = lens _dafmDimensions (\ s a -> s{_dafmDimensions = a}) . _Default . _Coerce;
-- | The statistic for the metric.
dafmStatistic :: Lens' DescribeAlarmsForMetric (Maybe Statistic)
-dafmStatistic = lens _dafmStatistic (\s a -> s { _dafmStatistic = a })
+dafmStatistic = lens _dafmStatistic (\ s a -> s{_dafmStatistic = a});
-- | The unit for the metric.
dafmUnit :: Lens' DescribeAlarmsForMetric (Maybe StandardUnit)
-dafmUnit = lens _dafmUnit (\s a -> s { _dafmUnit = a })
+dafmUnit = lens _dafmUnit (\ s a -> s{_dafmUnit = a});
-newtype DescribeAlarmsForMetricResponse = DescribeAlarmsForMetricResponse
- { _dafmrMetricAlarms :: List "member" MetricAlarm
- } deriving (Eq, Read, Show, Monoid, Semigroup)
+-- | The name of the metric.
+dafmMetricName :: Lens' DescribeAlarmsForMetric Text
+dafmMetricName = lens _dafmMetricName (\ s a -> s{_dafmMetricName = a});
-instance GHC.Exts.IsList DescribeAlarmsForMetricResponse where
- type Item DescribeAlarmsForMetricResponse = MetricAlarm
+-- | The namespace of the metric.
+dafmNamespace :: Lens' DescribeAlarmsForMetric Text
+dafmNamespace = lens _dafmNamespace (\ s a -> s{_dafmNamespace = a});
- fromList = DescribeAlarmsForMetricResponse . GHC.Exts.fromList
- toList = GHC.Exts.toList . _dafmrMetricAlarms
+instance AWSRequest DescribeAlarmsForMetric where
+ type Sv DescribeAlarmsForMetric = CloudWatch
+ type Rs DescribeAlarmsForMetric =
+ DescribeAlarmsForMetricResponse
+ request = postQuery
+ response
+ = receiveXMLWrapper "DescribeAlarmsForMetricResult"
+ (\ s h x ->
+ DescribeAlarmsForMetricResponse' <$>
+ (x .@? "MetricAlarms" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (pure (fromEnum s)))
+
+instance ToHeaders DescribeAlarmsForMetric where
+ toHeaders = const mempty
--- | 'DescribeAlarmsForMetricResponse' constructor.
+instance ToPath DescribeAlarmsForMetric where
+ toPath = const "/"
+
+instance ToQuery DescribeAlarmsForMetric where
+ toQuery DescribeAlarmsForMetric'{..}
+ = mconcat
+ ["Action" =:
+ ("DescribeAlarmsForMetric" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "Period" =: _dafmPeriod,
+ "Dimensions" =:
+ toQuery (toQueryList "member" <$> _dafmDimensions),
+ "Statistic" =: _dafmStatistic, "Unit" =: _dafmUnit,
+ "MetricName" =: _dafmMetricName,
+ "Namespace" =: _dafmNamespace]
+
+-- | The output for the DescribeAlarmsForMetric action.
--
--- The fields accessible through corresponding lenses are:
+-- /See:/ 'describeAlarmsForMetricResponse' smart constructor.
+data DescribeAlarmsForMetricResponse = DescribeAlarmsForMetricResponse'
+ { _dafmrsMetricAlarms :: !(Maybe [MetricAlarm])
+ , _dafmrsStatus :: !Int
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DescribeAlarmsForMetricResponse' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'dafmrMetricAlarms' @::@ ['MetricAlarm']
+-- * 'dafmrsMetricAlarms'
--
-describeAlarmsForMetricResponse :: DescribeAlarmsForMetricResponse
-describeAlarmsForMetricResponse = DescribeAlarmsForMetricResponse
- { _dafmrMetricAlarms = mempty
+-- * 'dafmrsStatus'
+describeAlarmsForMetricResponse
+ :: Int -- ^ 'dafmrsStatus'
+ -> DescribeAlarmsForMetricResponse
+describeAlarmsForMetricResponse pStatus_ =
+ DescribeAlarmsForMetricResponse'
+ { _dafmrsMetricAlarms = Nothing
+ , _dafmrsStatus = pStatus_
}
-- | A list of information for each alarm with the specified metric.
-dafmrMetricAlarms :: Lens' DescribeAlarmsForMetricResponse [MetricAlarm]
-dafmrMetricAlarms =
- lens _dafmrMetricAlarms (\s a -> s { _dafmrMetricAlarms = a })
- . _List
-
-instance ToPath DescribeAlarmsForMetric where
- toPath = const "/"
-
-instance ToQuery DescribeAlarmsForMetric where
- toQuery DescribeAlarmsForMetric{..} = mconcat
- [ "Dimensions" =? _dafmDimensions
- , "MetricName" =? _dafmMetricName
- , "Namespace" =? _dafmNamespace
- , "Period" =? _dafmPeriod
- , "Statistic" =? _dafmStatistic
- , "Unit" =? _dafmUnit
- ]
-
-instance ToHeaders DescribeAlarmsForMetric
-
-instance AWSRequest DescribeAlarmsForMetric where
- type Sv DescribeAlarmsForMetric = CloudWatch
- type Rs DescribeAlarmsForMetric = DescribeAlarmsForMetricResponse
-
- request = post "DescribeAlarmsForMetric"
- response = xmlResponse
+dafmrsMetricAlarms :: Lens' DescribeAlarmsForMetricResponse [MetricAlarm]
+dafmrsMetricAlarms = lens _dafmrsMetricAlarms (\ s a -> s{_dafmrsMetricAlarms = a}) . _Default . _Coerce;
-instance FromXML DescribeAlarmsForMetricResponse where
- parseXML = withElement "DescribeAlarmsForMetricResult" $ \x -> DescribeAlarmsForMetricResponse
- <$> x .@? "MetricAlarms" .!@ mempty
+-- | The response status code.
+dafmrsStatus :: Lens' DescribeAlarmsForMetricResponse Int
+dafmrsStatus = lens _dafmrsStatus (\ s a -> s{_dafmrsStatus = a});
diff --git a/gen/Network/AWS/CloudWatch/DisableAlarmActions.hs b/gen/Network/AWS/CloudWatch/DisableAlarmActions.hs
index 84e1abe..36580cc 100644
--- a/gen/Network/AWS/CloudWatch/DisableAlarmActions.hs
+++ b/gen/Network/AWS/CloudWatch/DisableAlarmActions.hs
@@ -1,97 +1,97 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.DisableAlarmActions
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Disables actions for the specified alarms. When an alarm's actions are
--- disabled the alarm's state may change, but none of the alarm's actions will
--- execute.
+-- Disables actions for the specified alarms. When an alarm\'s actions are
+-- disabled the alarm\'s state may change, but none of the alarm\'s actions
+-- will execute.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DisableAlarmActions.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DisableAlarmActions.html AWS API Reference> for DisableAlarmActions.
module Network.AWS.CloudWatch.DisableAlarmActions
(
- -- * Request
- DisableAlarmActions
- -- ** Request constructor
- , disableAlarmActions
- -- ** Request lenses
+ -- * Creating a Request
+ disableAlarmActions
+ , DisableAlarmActions
+ -- * Request Lenses
, daaAlarmNames
- -- * Response
- , DisableAlarmActionsResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, disableAlarmActionsResponse
+ , DisableAlarmActionsResponse
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-newtype DisableAlarmActions = DisableAlarmActions
- { _daaAlarmNames :: List "member" Text
- } deriving (Eq, Ord, Read, Show, Monoid, Semigroup)
-
-instance GHC.Exts.IsList DisableAlarmActions where
- type Item DisableAlarmActions = Text
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
- fromList = DisableAlarmActions . GHC.Exts.fromList
- toList = GHC.Exts.toList . _daaAlarmNames
-
--- | 'DisableAlarmActions' constructor.
+-- |
--
--- The fields accessible through corresponding lenses are:
+-- /See:/ 'disableAlarmActions' smart constructor.
+newtype DisableAlarmActions = DisableAlarmActions'
+ { _daaAlarmNames :: [Text]
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DisableAlarmActions' with the minimum fields required to make a request.
--
--- * 'daaAlarmNames' @::@ ['Text']
+-- Use one of the following lenses to modify other fields as desired:
--
-disableAlarmActions :: DisableAlarmActions
-disableAlarmActions = DisableAlarmActions
+-- * 'daaAlarmNames'
+disableAlarmActions
+ :: DisableAlarmActions
+disableAlarmActions =
+ DisableAlarmActions'
{ _daaAlarmNames = mempty
}
-- | The names of the alarms to disable actions for.
daaAlarmNames :: Lens' DisableAlarmActions [Text]
-daaAlarmNames = lens _daaAlarmNames (\s a -> s { _daaAlarmNames = a }) . _List
+daaAlarmNames = lens _daaAlarmNames (\ s a -> s{_daaAlarmNames = a}) . _Coerce;
-data DisableAlarmActionsResponse = DisableAlarmActionsResponse
- deriving (Eq, Ord, Read, Show, Generic)
+instance AWSRequest DisableAlarmActions where
+ type Sv DisableAlarmActions = CloudWatch
+ type Rs DisableAlarmActions =
+ DisableAlarmActionsResponse
+ request = postQuery
+ response = receiveNull DisableAlarmActionsResponse'
--- | 'DisableAlarmActionsResponse' constructor.
-disableAlarmActionsResponse :: DisableAlarmActionsResponse
-disableAlarmActionsResponse = DisableAlarmActionsResponse
+instance ToHeaders DisableAlarmActions where
+ toHeaders = const mempty
instance ToPath DisableAlarmActions where
- toPath = const "/"
+ toPath = const "/"
instance ToQuery DisableAlarmActions where
- toQuery DisableAlarmActions{..} = mconcat
- [ "AlarmNames" =? _daaAlarmNames
- ]
-
-instance ToHeaders DisableAlarmActions
-
-instance AWSRequest DisableAlarmActions where
- type Sv DisableAlarmActions = CloudWatch
- type Rs DisableAlarmActions = DisableAlarmActionsResponse
-
- request = post "DisableAlarmActions"
- response = nullResponse DisableAlarmActionsResponse
+ toQuery DisableAlarmActions'{..}
+ = mconcat
+ ["Action" =: ("DisableAlarmActions" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "AlarmNames" =: toQueryList "member" _daaAlarmNames]
+
+-- | /See:/ 'disableAlarmActionsResponse' smart constructor.
+data DisableAlarmActionsResponse =
+ DisableAlarmActionsResponse'
+ deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DisableAlarmActionsResponse' with the minimum fields required to make a request.
+--
+disableAlarmActionsResponse
+ :: DisableAlarmActionsResponse
+disableAlarmActionsResponse = DisableAlarmActionsResponse'
diff --git a/gen/Network/AWS/CloudWatch/EnableAlarmActions.hs b/gen/Network/AWS/CloudWatch/EnableAlarmActions.hs
index 8a64c1c..513894b 100644
--- a/gen/Network/AWS/CloudWatch/EnableAlarmActions.hs
+++ b/gen/Network/AWS/CloudWatch/EnableAlarmActions.hs
@@ -1,95 +1,93 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.EnableAlarmActions
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Enables actions for the specified alarms.
+-- Enables actions for the specified alarms.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_EnableAlarmActions.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_EnableAlarmActions.html AWS API Reference> for EnableAlarmActions.
module Network.AWS.CloudWatch.EnableAlarmActions
(
- -- * Request
- EnableAlarmActions
- -- ** Request constructor
- , enableAlarmActions
- -- ** Request lenses
+ -- * Creating a Request
+ enableAlarmActions
+ , EnableAlarmActions
+ -- * Request Lenses
, eaaAlarmNames
- -- * Response
- , EnableAlarmActionsResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, enableAlarmActionsResponse
+ , EnableAlarmActionsResponse
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-newtype EnableAlarmActions = EnableAlarmActions
- { _eaaAlarmNames :: List "member" Text
- } deriving (Eq, Ord, Read, Show, Monoid, Semigroup)
-
-instance GHC.Exts.IsList EnableAlarmActions where
- type Item EnableAlarmActions = Text
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
- fromList = EnableAlarmActions . GHC.Exts.fromList
- toList = GHC.Exts.toList . _eaaAlarmNames
+-- | /See:/ 'enableAlarmActions' smart constructor.
+newtype EnableAlarmActions = EnableAlarmActions'
+ { _eaaAlarmNames :: [Text]
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
--- | 'EnableAlarmActions' constructor.
+-- | Creates a value of 'EnableAlarmActions' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'eaaAlarmNames' @::@ ['Text']
---
-enableAlarmActions :: EnableAlarmActions
-enableAlarmActions = EnableAlarmActions
+-- * 'eaaAlarmNames'
+enableAlarmActions
+ :: EnableAlarmActions
+enableAlarmActions =
+ EnableAlarmActions'
{ _eaaAlarmNames = mempty
}
-- | The names of the alarms to enable actions for.
eaaAlarmNames :: Lens' EnableAlarmActions [Text]
-eaaAlarmNames = lens _eaaAlarmNames (\s a -> s { _eaaAlarmNames = a }) . _List
+eaaAlarmNames = lens _eaaAlarmNames (\ s a -> s{_eaaAlarmNames = a}) . _Coerce;
-data EnableAlarmActionsResponse = EnableAlarmActionsResponse
- deriving (Eq, Ord, Read, Show, Generic)
+instance AWSRequest EnableAlarmActions where
+ type Sv EnableAlarmActions = CloudWatch
+ type Rs EnableAlarmActions =
+ EnableAlarmActionsResponse
+ request = postQuery
+ response = receiveNull EnableAlarmActionsResponse'
--- | 'EnableAlarmActionsResponse' constructor.
-enableAlarmActionsResponse :: EnableAlarmActionsResponse
-enableAlarmActionsResponse = EnableAlarmActionsResponse
+instance ToHeaders EnableAlarmActions where
+ toHeaders = const mempty
instance ToPath EnableAlarmActions where
- toPath = const "/"
+ toPath = const "/"
instance ToQuery EnableAlarmActions where
- toQuery EnableAlarmActions{..} = mconcat
- [ "AlarmNames" =? _eaaAlarmNames
- ]
-
-instance ToHeaders EnableAlarmActions
-
-instance AWSRequest EnableAlarmActions where
- type Sv EnableAlarmActions = CloudWatch
- type Rs EnableAlarmActions = EnableAlarmActionsResponse
-
- request = post "EnableAlarmActions"
- response = nullResponse EnableAlarmActionsResponse
+ toQuery EnableAlarmActions'{..}
+ = mconcat
+ ["Action" =: ("EnableAlarmActions" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "AlarmNames" =: toQueryList "member" _eaaAlarmNames]
+
+-- | /See:/ 'enableAlarmActionsResponse' smart constructor.
+data EnableAlarmActionsResponse =
+ EnableAlarmActionsResponse'
+ deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'EnableAlarmActionsResponse' with the minimum fields required to make a request.
+--
+enableAlarmActionsResponse
+ :: EnableAlarmActionsResponse
+enableAlarmActionsResponse = EnableAlarmActionsResponse'
diff --git a/gen/Network/AWS/CloudWatch/GetMetricStatistics.hs b/gen/Network/AWS/CloudWatch/GetMetricStatistics.hs
index 9b6d9f9..b9f2d65 100644
--- a/gen/Network/AWS/CloudWatch/GetMetricStatistics.hs
+++ b/gen/Network/AWS/CloudWatch/GetMetricStatistics.hs
@@ -1,225 +1,247 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.GetMetricStatistics
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Gets statistics for the specified metric.
+-- Gets statistics for the specified metric.
--
--- The maximum number of data points returned from a single 'GetMetricStatistics'
--- request is 1,440, wereas the maximum number of data points that can be
--- queried is 50,850. If you make a request that generates more than 1,440 data
--- points, Amazon CloudWatch returns an error. In such a case, you can alter the
--- request by narrowing the specified time range or increasing the specified
--- period. Alternatively, you can make multiple requests across adjacent time
--- ranges.
+-- The maximum number of data points returned from a single
+-- 'GetMetricStatistics' request is 1,440, wereas the maximum number of
+-- data points that can be queried is 50,850. If you make a request that
+-- generates more than 1,440 data points, Amazon CloudWatch returns an
+-- error. In such a case, you can alter the request by narrowing the
+-- specified time range or increasing the specified period. Alternatively,
+-- you can make multiple requests across adjacent time ranges.
--
--- Amazon CloudWatch aggregates data points based on the length of the 'period'
--- that you specify. For example, if you request statistics with a one-minute
--- granularity, Amazon CloudWatch aggregates data points with time stamps that
--- fall within the same one-minute period. In such a case, the data points
--- queried can greatly outnumber the data points returned.
+-- Amazon CloudWatch aggregates data points based on the length of the
+-- 'period' that you specify. For example, if you request statistics with a
+-- one-minute granularity, Amazon CloudWatch aggregates data points with
+-- time stamps that fall within the same one-minute period. In such a case,
+-- the data points queried can greatly outnumber the data points returned.
--
-- The following examples show various statistics allowed by the data point
--- query maximum of 50,850 when you call 'GetMetricStatistics' on Amazon EC2
--- instances with detailed (one-minute) monitoring enabled:
+-- query maximum of 50,850 when you call 'GetMetricStatistics' on Amazon
+-- EC2 instances with detailed (one-minute) monitoring enabled:
--
--- Statistics for up to 400 instances for a span of one hour Statistics for up
--- to 35 instances over a span of 24 hours Statistics for up to 2 instances over
--- a span of 2 weeks For information about the namespace, metric names, and
--- dimensions that other Amazon Web Services products use to send metrics to
--- Cloudwatch, go to <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html Amazon CloudWatch Metrics, Namespaces, and DimensionsReference> in the /Amazon CloudWatch Developer Guide/.
+-- - Statistics for up to 400 instances for a span of one hour
+-- - Statistics for up to 35 instances over a span of 24 hours
+-- - Statistics for up to 2 instances over a span of 2 weeks
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html>
+-- For information about the namespace, metric names, and dimensions that
+-- other Amazon Web Services products use to send metrics to Cloudwatch, go
+-- to
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference>
+-- in the /Amazon CloudWatch Developer Guide/.
+--
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html AWS API Reference> for GetMetricStatistics.
module Network.AWS.CloudWatch.GetMetricStatistics
(
- -- * Request
- GetMetricStatistics
- -- ** Request constructor
- , getMetricStatistics
- -- ** Request lenses
+ -- * Creating a Request
+ getMetricStatistics
+ , GetMetricStatistics
+ -- * Request Lenses
, gmsDimensions
- , gmsEndTime
- , gmsMetricName
+ , gmsUnit
, gmsNamespace
- , gmsPeriod
+ , gmsMetricName
, gmsStartTime
+ , gmsEndTime
+ , gmsPeriod
, gmsStatistics
- , gmsUnit
- -- * Response
- , GetMetricStatisticsResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, getMetricStatisticsResponse
- -- ** Response lenses
- , gmsrDatapoints
- , gmsrLabel
+ , GetMetricStatisticsResponse
+ -- * Response Lenses
+ , gmsrsDatapoints
+ , gmsrsLabel
+ , gmsrsStatus
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-data GetMetricStatistics = GetMetricStatistics
- { _gmsDimensions :: List "member" Dimension
- , _gmsEndTime :: ISO8601
- , _gmsMetricName :: Text
- , _gmsNamespace :: Text
- , _gmsPeriod :: Nat
- , _gmsStartTime :: ISO8601
- , _gmsStatistics :: List1 "member" Statistic
- , _gmsUnit :: Maybe StandardUnit
- } deriving (Eq, Read, Show)
-
--- | 'GetMetricStatistics' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'gmsDimensions' @::@ ['Dimension']
---
--- * 'gmsEndTime' @::@ 'UTCTime'
---
--- * 'gmsMetricName' @::@ 'Text'
---
--- * 'gmsNamespace' @::@ 'Text'
---
--- * 'gmsPeriod' @::@ 'Natural'
---
--- * 'gmsStartTime' @::@ 'UTCTime'
---
--- * 'gmsStatistics' @::@ 'NonEmpty' 'Statistic'
---
--- * 'gmsUnit' @::@ 'Maybe' 'StandardUnit'
---
-getMetricStatistics :: Text -- ^ 'gmsNamespace'
- -> Text -- ^ 'gmsMetricName'
- -> UTCTime -- ^ 'gmsStartTime'
- -> UTCTime -- ^ 'gmsEndTime'
- -> Natural -- ^ 'gmsPeriod'
- -> NonEmpty Statistic -- ^ 'gmsStatistics'
- -> GetMetricStatistics
-getMetricStatistics p1 p2 p3 p4 p5 p6 = GetMetricStatistics
- { _gmsNamespace = p1
- , _gmsMetricName = p2
- , _gmsStartTime = withIso _Time (const id) p3
- , _gmsEndTime = withIso _Time (const id) p4
- , _gmsPeriod = withIso _Nat (const id) p5
- , _gmsStatistics = withIso _List1 (const id) p6
- , _gmsDimensions = mempty
- , _gmsUnit = Nothing
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
+
+-- | /See:/ 'getMetricStatistics' smart constructor.
+data GetMetricStatistics = GetMetricStatistics'
+ { _gmsDimensions :: !(Maybe [Dimension])
+ , _gmsUnit :: !(Maybe StandardUnit)
+ , _gmsNamespace :: !Text
+ , _gmsMetricName :: !Text
+ , _gmsStartTime :: !ISO8601
+ , _gmsEndTime :: !ISO8601
+ , _gmsPeriod :: !Nat
+ , _gmsStatistics :: !(List1 Statistic)
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'GetMetricStatistics' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'gmsDimensions'
+--
+-- * 'gmsUnit'
+--
+-- * 'gmsNamespace'
+--
+-- * 'gmsMetricName'
+--
+-- * 'gmsStartTime'
+--
+-- * 'gmsEndTime'
+--
+-- * 'gmsPeriod'
+--
+-- * 'gmsStatistics'
+getMetricStatistics
+ :: Text -- ^ 'gmsNamespace'
+ -> Text -- ^ 'gmsMetricName'
+ -> UTCTime -- ^ 'gmsStartTime'
+ -> UTCTime -- ^ 'gmsEndTime'
+ -> Natural -- ^ 'gmsPeriod'
+ -> NonEmpty Statistic -- ^ 'gmsStatistics'
+ -> GetMetricStatistics
+getMetricStatistics pNamespace_ pMetricName_ pStartTime_ pEndTime_ pPeriod_ pStatistics_ =
+ GetMetricStatistics'
+ { _gmsDimensions = Nothing
+ , _gmsUnit = Nothing
+ , _gmsNamespace = pNamespace_
+ , _gmsMetricName = pMetricName_
+ , _gmsStartTime = _Time # pStartTime_
+ , _gmsEndTime = _Time # pEndTime_
+ , _gmsPeriod = _Nat # pPeriod_
+ , _gmsStatistics = _List1 # pStatistics_
}
-- | A list of dimensions describing qualities of the metric.
gmsDimensions :: Lens' GetMetricStatistics [Dimension]
-gmsDimensions = lens _gmsDimensions (\s a -> s { _gmsDimensions = a }) . _List
-
--- | The time stamp to use for determining the last datapoint to return. The
--- value specified is exclusive; results will include datapoints up to the time
--- stamp specified.
-gmsEndTime :: Lens' GetMetricStatistics UTCTime
-gmsEndTime = lens _gmsEndTime (\s a -> s { _gmsEndTime = a }) . _Time
+gmsDimensions = lens _gmsDimensions (\ s a -> s{_gmsDimensions = a}) . _Default . _Coerce;
--- | The name of the metric, with or without spaces.
-gmsMetricName :: Lens' GetMetricStatistics Text
-gmsMetricName = lens _gmsMetricName (\s a -> s { _gmsMetricName = a })
+-- | The unit for the metric.
+gmsUnit :: Lens' GetMetricStatistics (Maybe StandardUnit)
+gmsUnit = lens _gmsUnit (\ s a -> s{_gmsUnit = a});
-- | The namespace of the metric, with or without spaces.
gmsNamespace :: Lens' GetMetricStatistics Text
-gmsNamespace = lens _gmsNamespace (\s a -> s { _gmsNamespace = a })
+gmsNamespace = lens _gmsNamespace (\ s a -> s{_gmsNamespace = a});
--- | The granularity, in seconds, of the returned datapoints. 'Period' must be at
--- least 60 seconds and must be a multiple of 60. The default value is 60.
-gmsPeriod :: Lens' GetMetricStatistics Natural
-gmsPeriod = lens _gmsPeriod (\s a -> s { _gmsPeriod = a }) . _Nat
+-- | The name of the metric, with or without spaces.
+gmsMetricName :: Lens' GetMetricStatistics Text
+gmsMetricName = lens _gmsMetricName (\ s a -> s{_gmsMetricName = a});
-- | The time stamp to use for determining the first datapoint to return. The
--- value specified is inclusive; results include datapoints with the time stamp
--- specified.
+-- value specified is inclusive; results include datapoints with the time
+-- stamp specified.
gmsStartTime :: Lens' GetMetricStatistics UTCTime
-gmsStartTime = lens _gmsStartTime (\s a -> s { _gmsStartTime = a }) . _Time
+gmsStartTime = lens _gmsStartTime (\ s a -> s{_gmsStartTime = a}) . _Time;
+
+-- | The time stamp to use for determining the last datapoint to return. The
+-- value specified is exclusive; results will include datapoints up to the
+-- time stamp specified.
+gmsEndTime :: Lens' GetMetricStatistics UTCTime
+gmsEndTime = lens _gmsEndTime (\ s a -> s{_gmsEndTime = a}) . _Time;
--- | The metric statistics to return. For information about specific statistics
--- returned by GetMetricStatistics, go to <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/index.html?CHAP_TerminologyandKeyConcepts.html#Statistic Statistics> in the /Amazon CloudWatchDeveloper Guide/.
+-- | The granularity, in seconds, of the returned datapoints. 'Period' must
+-- be at least 60 seconds and must be a multiple of 60. The default value
+-- is 60.
+gmsPeriod :: Lens' GetMetricStatistics Natural
+gmsPeriod = lens _gmsPeriod (\ s a -> s{_gmsPeriod = a}) . _Nat;
+
+-- | The metric statistics to return. For information about specific
+-- statistics returned by GetMetricStatistics, go to
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/index.html?CHAP_TerminologyandKeyConcepts.html#Statistic Statistics>
+-- in the /Amazon CloudWatch Developer Guide/.
--
-- Valid Values: 'Average | Sum | SampleCount | Maximum | Minimum'
gmsStatistics :: Lens' GetMetricStatistics (NonEmpty Statistic)
-gmsStatistics = lens _gmsStatistics (\s a -> s { _gmsStatistics = a }) . _List1
+gmsStatistics = lens _gmsStatistics (\ s a -> s{_gmsStatistics = a}) . _List1;
--- | The unit for the metric.
-gmsUnit :: Lens' GetMetricStatistics (Maybe StandardUnit)
-gmsUnit = lens _gmsUnit (\s a -> s { _gmsUnit = a })
+instance AWSRequest GetMetricStatistics where
+ type Sv GetMetricStatistics = CloudWatch
+ type Rs GetMetricStatistics =
+ GetMetricStatisticsResponse
+ request = postQuery
+ response
+ = receiveXMLWrapper "GetMetricStatisticsResult"
+ (\ s h x ->
+ GetMetricStatisticsResponse' <$>
+ (x .@? "Datapoints" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "Label")
+ <*> (pure (fromEnum s)))
+
+instance ToHeaders GetMetricStatistics where
+ toHeaders = const mempty
-data GetMetricStatisticsResponse = GetMetricStatisticsResponse
- { _gmsrDatapoints :: List "member" Datapoint
- , _gmsrLabel :: Maybe Text
- } deriving (Eq, Read, Show)
+instance ToPath GetMetricStatistics where
+ toPath = const "/"
--- | 'GetMetricStatisticsResponse' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'gmsrDatapoints' @::@ ['Datapoint']
---
--- * 'gmsrLabel' @::@ 'Maybe' 'Text'
---
-getMetricStatisticsResponse :: GetMetricStatisticsResponse
-getMetricStatisticsResponse = GetMetricStatisticsResponse
- { _gmsrLabel = Nothing
- , _gmsrDatapoints = mempty
+instance ToQuery GetMetricStatistics where
+ toQuery GetMetricStatistics'{..}
+ = mconcat
+ ["Action" =: ("GetMetricStatistics" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "Dimensions" =:
+ toQuery (toQueryList "member" <$> _gmsDimensions),
+ "Unit" =: _gmsUnit, "Namespace" =: _gmsNamespace,
+ "MetricName" =: _gmsMetricName,
+ "StartTime" =: _gmsStartTime,
+ "EndTime" =: _gmsEndTime, "Period" =: _gmsPeriod,
+ "Statistics" =: toQueryList "member" _gmsStatistics]
+
+-- | The output for the GetMetricStatistics action.
+--
+-- /See:/ 'getMetricStatisticsResponse' smart constructor.
+data GetMetricStatisticsResponse = GetMetricStatisticsResponse'
+ { _gmsrsDatapoints :: !(Maybe [Datapoint])
+ , _gmsrsLabel :: !(Maybe Text)
+ , _gmsrsStatus :: !Int
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'GetMetricStatisticsResponse' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'gmsrsDatapoints'
+--
+-- * 'gmsrsLabel'
+--
+-- * 'gmsrsStatus'
+getMetricStatisticsResponse
+ :: Int -- ^ 'gmsrsStatus'
+ -> GetMetricStatisticsResponse
+getMetricStatisticsResponse pStatus_ =
+ GetMetricStatisticsResponse'
+ { _gmsrsDatapoints = Nothing
+ , _gmsrsLabel = Nothing
+ , _gmsrsStatus = pStatus_
}
-- | The datapoints for the specified metric.
-gmsrDatapoints :: Lens' GetMetricStatisticsResponse [Datapoint]
-gmsrDatapoints = lens _gmsrDatapoints (\s a -> s { _gmsrDatapoints = a }) . _List
+gmsrsDatapoints :: Lens' GetMetricStatisticsResponse [Datapoint]
+gmsrsDatapoints = lens _gmsrsDatapoints (\ s a -> s{_gmsrsDatapoints = a}) . _Default . _Coerce;
-- | A label describing the specified metric.
-gmsrLabel :: Lens' GetMetricStatisticsResponse (Maybe Text)
-gmsrLabel = lens _gmsrLabel (\s a -> s { _gmsrLabel = a })
-
-instance ToPath GetMetricStatistics where
- toPath = const "/"
-
-instance ToQuery GetMetricStatistics where
- toQuery GetMetricStatistics{..} = mconcat
- [ "Dimensions" =? _gmsDimensions
- , "EndTime" =? _gmsEndTime
- , "MetricName" =? _gmsMetricName
- , "Namespace" =? _gmsNamespace
- , "Period" =? _gmsPeriod
- , "StartTime" =? _gmsStartTime
- , "Statistics" =? _gmsStatistics
- , "Unit" =? _gmsUnit
- ]
-
-instance ToHeaders GetMetricStatistics
-
-instance AWSRequest GetMetricStatistics where
- type Sv GetMetricStatistics = CloudWatch
- type Rs GetMetricStatistics = GetMetricStatisticsResponse
-
- request = post "GetMetricStatistics"
- response = xmlResponse
+gmsrsLabel :: Lens' GetMetricStatisticsResponse (Maybe Text)
+gmsrsLabel = lens _gmsrsLabel (\ s a -> s{_gmsrsLabel = a});
-instance FromXML GetMetricStatisticsResponse where
- parseXML = withElement "GetMetricStatisticsResult" $ \x -> GetMetricStatisticsResponse
- <$> x .@? "Datapoints" .!@ mempty
- <*> x .@? "Label"
+-- | The response status code.
+gmsrsStatus :: Lens' GetMetricStatisticsResponse Int
+gmsrsStatus = lens _gmsrsStatus (\ s a -> s{_gmsrsStatus = a});
diff --git a/gen/Network/AWS/CloudWatch/ListMetrics.hs b/gen/Network/AWS/CloudWatch/ListMetrics.hs
index 469b522..89fbda8 100644
--- a/gen/Network/AWS/CloudWatch/ListMetrics.hs
+++ b/gen/Network/AWS/CloudWatch/ListMetrics.hs
@@ -1,156 +1,176 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.ListMetrics
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Returns a list of valid metrics stored for the AWS account owner. Returned
--- metrics can be used with 'GetMetricStatistics' to obtain statistical data for a
--- given metric.
+-- Returns a list of valid metrics stored for the AWS account owner.
+-- Returned metrics can be used with GetMetricStatistics to obtain
+-- statistical data for a given metric.
+--
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html AWS API Reference> for ListMetrics.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html>
+-- This operation returns paginated results.
module Network.AWS.CloudWatch.ListMetrics
(
- -- * Request
- ListMetrics
- -- ** Request constructor
- , listMetrics
- -- ** Request lenses
- , lmDimensions
+ -- * Creating a Request
+ listMetrics
+ , ListMetrics
+ -- * Request Lenses
, lmMetricName
, lmNamespace
, lmNextToken
+ , lmDimensions
- -- * Response
- , ListMetricsResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, listMetricsResponse
- -- ** Response lenses
- , lmrMetrics
- , lmrNextToken
+ , ListMetricsResponse
+ -- * Response Lenses
+ , lmrsMetrics
+ , lmrsNextToken
+ , lmrsStatus
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-data ListMetrics = ListMetrics
- { _lmDimensions :: List "member" DimensionFilter
- , _lmMetricName :: Maybe Text
- , _lmNamespace :: Maybe Text
- , _lmNextToken :: Maybe Text
- } deriving (Eq, Read, Show)
-
--- | 'ListMetrics' constructor.
---
--- The fields accessible through corresponding lenses are:
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Pager
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
+
+-- | /See:/ 'listMetrics' smart constructor.
+data ListMetrics = ListMetrics'
+ { _lmMetricName :: !(Maybe Text)
+ , _lmNamespace :: !(Maybe Text)
+ , _lmNextToken :: !(Maybe Text)
+ , _lmDimensions :: !(Maybe [DimensionFilter])
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'ListMetrics' with the minimum fields required to make a request.
--
--- * 'lmDimensions' @::@ ['DimensionFilter']
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'lmMetricName' @::@ 'Maybe' 'Text'
+-- * 'lmMetricName'
--
--- * 'lmNamespace' @::@ 'Maybe' 'Text'
+-- * 'lmNamespace'
--
--- * 'lmNextToken' @::@ 'Maybe' 'Text'
+-- * 'lmNextToken'
--
-listMetrics :: ListMetrics
-listMetrics = ListMetrics
- { _lmNamespace = Nothing
- , _lmMetricName = Nothing
- , _lmDimensions = mempty
- , _lmNextToken = Nothing
+-- * 'lmDimensions'
+listMetrics
+ :: ListMetrics
+listMetrics =
+ ListMetrics'
+ { _lmMetricName = Nothing
+ , _lmNamespace = Nothing
+ , _lmNextToken = Nothing
+ , _lmDimensions = Nothing
}
--- | A list of dimensions to filter against.
-lmDimensions :: Lens' ListMetrics [DimensionFilter]
-lmDimensions = lens _lmDimensions (\s a -> s { _lmDimensions = a }) . _List
-
-- | The name of the metric to filter against.
lmMetricName :: Lens' ListMetrics (Maybe Text)
-lmMetricName = lens _lmMetricName (\s a -> s { _lmMetricName = a })
+lmMetricName = lens _lmMetricName (\ s a -> s{_lmMetricName = a});
-- | The namespace to filter against.
lmNamespace :: Lens' ListMetrics (Maybe Text)
-lmNamespace = lens _lmNamespace (\s a -> s { _lmNamespace = a })
+lmNamespace = lens _lmNamespace (\ s a -> s{_lmNamespace = a});
--- | The token returned by a previous call to indicate that there is more data
--- available.
+-- | The token returned by a previous call to indicate that there is more
+-- data available.
lmNextToken :: Lens' ListMetrics (Maybe Text)
-lmNextToken = lens _lmNextToken (\s a -> s { _lmNextToken = a })
+lmNextToken = lens _lmNextToken (\ s a -> s{_lmNextToken = a});
-data ListMetricsResponse = ListMetricsResponse
- { _lmrMetrics :: List "member" Metric
- , _lmrNextToken :: Maybe Text
- } deriving (Eq, Read, Show)
+-- | A list of dimensions to filter against.
+lmDimensions :: Lens' ListMetrics [DimensionFilter]
+lmDimensions = lens _lmDimensions (\ s a -> s{_lmDimensions = a}) . _Default . _Coerce;
--- | 'ListMetricsResponse' constructor.
+instance AWSPager ListMetrics where
+ page rq rs
+ | stop (rs ^. lmrsNextToken) = Nothing
+ | stop (rs ^. lmrsMetrics) = Nothing
+ | otherwise =
+ Just $ rq & lmNextToken .~ rs ^. lmrsNextToken
+
+instance AWSRequest ListMetrics where
+ type Sv ListMetrics = CloudWatch
+ type Rs ListMetrics = ListMetricsResponse
+ request = postQuery
+ response
+ = receiveXMLWrapper "ListMetricsResult"
+ (\ s h x ->
+ ListMetricsResponse' <$>
+ (x .@? "Metrics" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "NextToken")
+ <*> (pure (fromEnum s)))
+
+instance ToHeaders ListMetrics where
+ toHeaders = const mempty
+
+instance ToPath ListMetrics where
+ toPath = const "/"
+
+instance ToQuery ListMetrics where
+ toQuery ListMetrics'{..}
+ = mconcat
+ ["Action" =: ("ListMetrics" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "MetricName" =: _lmMetricName,
+ "Namespace" =: _lmNamespace,
+ "NextToken" =: _lmNextToken,
+ "Dimensions" =:
+ toQuery (toQueryList "member" <$> _lmDimensions)]
+
+-- | The output for the ListMetrics action.
+--
+-- /See:/ 'listMetricsResponse' smart constructor.
+data ListMetricsResponse = ListMetricsResponse'
+ { _lmrsMetrics :: !(Maybe [Metric])
+ , _lmrsNextToken :: !(Maybe Text)
+ , _lmrsStatus :: !Int
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'ListMetricsResponse' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'lmrMetrics' @::@ ['Metric']
+-- * 'lmrsMetrics'
--
--- * 'lmrNextToken' @::@ 'Maybe' 'Text'
+-- * 'lmrsNextToken'
--
-listMetricsResponse :: ListMetricsResponse
-listMetricsResponse = ListMetricsResponse
- { _lmrMetrics = mempty
- , _lmrNextToken = Nothing
+-- * 'lmrsStatus'
+listMetricsResponse
+ :: Int -- ^ 'lmrsStatus'
+ -> ListMetricsResponse
+listMetricsResponse pStatus_ =
+ ListMetricsResponse'
+ { _lmrsMetrics = Nothing
+ , _lmrsNextToken = Nothing
+ , _lmrsStatus = pStatus_
}
-- | A list of metrics used to generate statistics for an AWS account.
-lmrMetrics :: Lens' ListMetricsResponse [Metric]
-lmrMetrics = lens _lmrMetrics (\s a -> s { _lmrMetrics = a }) . _List
+lmrsMetrics :: Lens' ListMetricsResponse [Metric]
+lmrsMetrics = lens _lmrsMetrics (\ s a -> s{_lmrsMetrics = a}) . _Default . _Coerce;
-- | A string that marks the start of the next batch of returned results.
-lmrNextToken :: Lens' ListMetricsResponse (Maybe Text)
-lmrNextToken = lens _lmrNextToken (\s a -> s { _lmrNextToken = a })
-
-instance ToPath ListMetrics where
- toPath = const "/"
+lmrsNextToken :: Lens' ListMetricsResponse (Maybe Text)
+lmrsNextToken = lens _lmrsNextToken (\ s a -> s{_lmrsNextToken = a});
-instance ToQuery ListMetrics where
- toQuery ListMetrics{..} = mconcat
- [ "Dimensions" =? _lmDimensions
- , "MetricName" =? _lmMetricName
- , "Namespace" =? _lmNamespace
- , "NextToken" =? _lmNextToken
- ]
-
-instance ToHeaders ListMetrics
-
-instance AWSRequest ListMetrics where
- type Sv ListMetrics = CloudWatch
- type Rs ListMetrics = ListMetricsResponse
-
- request = post "ListMetrics"
- response = xmlResponse
-
-instance FromXML ListMetricsResponse where
- parseXML = withElement "ListMetricsResult" $ \x -> ListMetricsResponse
- <$> x .@? "Metrics" .!@ mempty
- <*> x .@? "NextToken"
-
-instance AWSPager ListMetrics where
- page rq rs
- | stop (rs ^. lmrNextToken) = Nothing
- | otherwise = (\x -> rq & lmNextToken ?~ x)
- <$> (rs ^. lmrNextToken)
+-- | The response status code.
+lmrsStatus :: Lens' ListMetricsResponse Int
+lmrsStatus = lens _lmrsStatus (\ s a -> s{_lmrsStatus = a});
diff --git a/gen/Network/AWS/CloudWatch/PutMetricAlarm.hs b/gen/Network/AWS/CloudWatch/PutMetricAlarm.hs
index f9638cc..a82307c 100644
--- a/gen/Network/AWS/CloudWatch/PutMetricAlarm.hs
+++ b/gen/Network/AWS/CloudWatch/PutMetricAlarm.hs
@@ -1,261 +1,265 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.PutMetricAlarm
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Creates or updates an alarm and associates it with the specified Amazon
+-- Creates or updates an alarm and associates it with the specified Amazon
-- CloudWatch metric. Optionally, this operation can associate one or more
-- Amazon Simple Notification Service resources with the alarm.
--
--- When this operation creates an alarm, the alarm state is immediately set to 'INSUFFICIENT_DATA'. The alarm is evaluated and its 'StateValue' is set
--- appropriately. Any actions associated with the 'StateValue' is then executed.
+-- When this operation creates an alarm, the alarm state is immediately set
+-- to 'INSUFFICIENT_DATA'. The alarm is evaluated and its 'StateValue' is
+-- set appropriately. Any actions associated with the 'StateValue' is then
+-- executed.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html AWS API Reference> for PutMetricAlarm.
module Network.AWS.CloudWatch.PutMetricAlarm
(
- -- * Request
- PutMetricAlarm
- -- ** Request constructor
- , putMetricAlarm
- -- ** Request lenses
+ -- * Creating a Request
+ putMetricAlarm
+ , PutMetricAlarm
+ -- * Request Lenses
+ , pmaAlarmDescription
+ , pmaOKActions
, pmaActionsEnabled
+ , pmaInsufficientDataActions
+ , pmaDimensions
, pmaAlarmActions
- , pmaAlarmDescription
+ , pmaUnit
, pmaAlarmName
- , pmaComparisonOperator
- , pmaDimensions
- , pmaEvaluationPeriods
- , pmaInsufficientDataActions
, pmaMetricName
, pmaNamespace
- , pmaOKActions
- , pmaPeriod
, pmaStatistic
+ , pmaPeriod
+ , pmaEvaluationPeriods
, pmaThreshold
- , pmaUnit
+ , pmaComparisonOperator
- -- * Response
- , PutMetricAlarmResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, putMetricAlarmResponse
+ , PutMetricAlarmResponse
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
-data PutMetricAlarm = PutMetricAlarm
- { _pmaActionsEnabled :: Maybe Bool
- , _pmaAlarmActions :: List "member" Text
- , _pmaAlarmDescription :: Maybe Text
- , _pmaAlarmName :: Text
- , _pmaComparisonOperator :: ComparisonOperator
- , _pmaDimensions :: List "member" Dimension
- , _pmaEvaluationPeriods :: Nat
- , _pmaInsufficientDataActions :: List "member" Text
- , _pmaMetricName :: Text
- , _pmaNamespace :: Text
- , _pmaOKActions :: List "member" Text
- , _pmaPeriod :: Nat
- , _pmaStatistic :: Statistic
- , _pmaThreshold :: Double
- , _pmaUnit :: Maybe StandardUnit
- } deriving (Eq, Read, Show)
+-- | /See:/ 'putMetricAlarm' smart constructor.
+data PutMetricAlarm = PutMetricAlarm'
+ { _pmaAlarmDescription :: !(Maybe Text)
+ , _pmaOKActions :: !(Maybe [Text])
+ , _pmaActionsEnabled :: !(Maybe Bool)
+ , _pmaInsufficientDataActions :: !(Maybe [Text])
+ , _pmaDimensions :: !(Maybe [Dimension])
+ , _pmaAlarmActions :: !(Maybe [Text])
+ , _pmaUnit :: !(Maybe StandardUnit)
+ , _pmaAlarmName :: !Text
+ , _pmaMetricName :: !Text
+ , _pmaNamespace :: !Text
+ , _pmaStatistic :: !Statistic
+ , _pmaPeriod :: !Nat
+ , _pmaEvaluationPeriods :: !Nat
+ , _pmaThreshold :: !Double
+ , _pmaComparisonOperator :: !ComparisonOperator
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
--- | 'PutMetricAlarm' constructor.
---
--- The fields accessible through corresponding lenses are:
+-- | Creates a value of 'PutMetricAlarm' with the minimum fields required to make a request.
--
--- * 'pmaActionsEnabled' @::@ 'Maybe' 'Bool'
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'pmaAlarmActions' @::@ ['Text']
+-- * 'pmaAlarmDescription'
--
--- * 'pmaAlarmDescription' @::@ 'Maybe' 'Text'
+-- * 'pmaOKActions'
--
--- * 'pmaAlarmName' @::@ 'Text'
+-- * 'pmaActionsEnabled'
--
--- * 'pmaComparisonOperator' @::@ 'ComparisonOperator'
+-- * 'pmaInsufficientDataActions'
--
--- * 'pmaDimensions' @::@ ['Dimension']
+-- * 'pmaDimensions'
--
--- * 'pmaEvaluationPeriods' @::@ 'Natural'
+-- * 'pmaAlarmActions'
--
--- * 'pmaInsufficientDataActions' @::@ ['Text']
+-- * 'pmaUnit'
--
--- * 'pmaMetricName' @::@ 'Text'
+-- * 'pmaAlarmName'
--
--- * 'pmaNamespace' @::@ 'Text'
+-- * 'pmaMetricName'
--
--- * 'pmaOKActions' @::@ ['Text']
+-- * 'pmaNamespace'
--
--- * 'pmaPeriod' @::@ 'Natural'
+-- * 'pmaStatistic'
--
--- * 'pmaStatistic' @::@ 'Statistic'
+-- * 'pmaPeriod'
--
--- * 'pmaThreshold' @::@ 'Double'
+-- * 'pmaEvaluationPeriods'
--
--- * 'pmaUnit' @::@ 'Maybe' 'StandardUnit'
+-- * 'pmaThreshold'
--
-putMetricAlarm :: Text -- ^ 'pmaAlarmName'
- -> Text -- ^ 'pmaMetricName'
- -> Text -- ^ 'pmaNamespace'
- -> Statistic -- ^ 'pmaStatistic'
- -> Natural -- ^ 'pmaPeriod'
- -> Natural -- ^ 'pmaEvaluationPeriods'
- -> Double -- ^ 'pmaThreshold'
- -> ComparisonOperator -- ^ 'pmaComparisonOperator'
- -> PutMetricAlarm
-putMetricAlarm p1 p2 p3 p4 p5 p6 p7 p8 = PutMetricAlarm
- { _pmaAlarmName = p1
- , _pmaMetricName = p2
- , _pmaNamespace = p3
- , _pmaStatistic = p4
- , _pmaPeriod = withIso _Nat (const id) p5
- , _pmaEvaluationPeriods = withIso _Nat (const id) p6
- , _pmaThreshold = p7
- , _pmaComparisonOperator = p8
- , _pmaAlarmDescription = Nothing
- , _pmaActionsEnabled = Nothing
- , _pmaOKActions = mempty
- , _pmaAlarmActions = mempty
- , _pmaInsufficientDataActions = mempty
- , _pmaDimensions = mempty
- , _pmaUnit = Nothing
+-- * 'pmaComparisonOperator'
+putMetricAlarm
+ :: Text -- ^ 'pmaAlarmName'
+ -> Text -- ^ 'pmaMetricName'
+ -> Text -- ^ 'pmaNamespace'
+ -> Statistic -- ^ 'pmaStatistic'
+ -> Natural -- ^ 'pmaPeriod'
+ -> Natural -- ^ 'pmaEvaluationPeriods'
+ -> Double -- ^ 'pmaThreshold'
+ -> ComparisonOperator -- ^ 'pmaComparisonOperator'
+ -> PutMetricAlarm
+putMetricAlarm pAlarmName_ pMetricName_ pNamespace_ pStatistic_ pPeriod_ pEvaluationPeriods_ pThreshold_ pComparisonOperator_ =
+ PutMetricAlarm'
+ { _pmaAlarmDescription = Nothing
+ , _pmaOKActions = Nothing
+ , _pmaActionsEnabled = Nothing
+ , _pmaInsufficientDataActions = Nothing
+ , _pmaDimensions = Nothing
+ , _pmaAlarmActions = Nothing
+ , _pmaUnit = Nothing
+ , _pmaAlarmName = pAlarmName_
+ , _pmaMetricName = pMetricName_
+ , _pmaNamespace = pNamespace_
+ , _pmaStatistic = pStatistic_
+ , _pmaPeriod = _Nat # pPeriod_
+ , _pmaEvaluationPeriods = _Nat # pEvaluationPeriods_
+ , _pmaThreshold = pThreshold_
+ , _pmaComparisonOperator = pComparisonOperator_
}
--- | Indicates whether or not actions should be executed during any changes to
--- the alarm's state.
-pmaActionsEnabled :: Lens' PutMetricAlarm (Maybe Bool)
-pmaActionsEnabled =
- lens _pmaActionsEnabled (\s a -> s { _pmaActionsEnabled = a })
-
--- | The list of actions to execute when this alarm transitions into an 'ALARM'
--- state from any other state. Each action is specified as an Amazon Resource
--- Number (ARN). Currently the only action supported is publishing to an Amazon
--- SNS topic or an Amazon Auto Scaling policy.
-pmaAlarmActions :: Lens' PutMetricAlarm [Text]
-pmaAlarmActions = lens _pmaAlarmActions (\s a -> s { _pmaAlarmActions = a }) . _List
-
-- | The description for the alarm.
pmaAlarmDescription :: Lens' PutMetricAlarm (Maybe Text)
-pmaAlarmDescription =
- lens _pmaAlarmDescription (\s a -> s { _pmaAlarmDescription = a })
+pmaAlarmDescription = lens _pmaAlarmDescription (\ s a -> s{_pmaAlarmDescription = a});
--- | The descriptive name for the alarm. This name must be unique within the
--- user's AWS account
-pmaAlarmName :: Lens' PutMetricAlarm Text
-pmaAlarmName = lens _pmaAlarmName (\s a -> s { _pmaAlarmName = a })
+-- | The list of actions to execute when this alarm transitions into an 'OK'
+-- state from any other state. Each action is specified as an Amazon
+-- Resource Number (ARN). Currently the only action supported is publishing
+-- to an Amazon SNS topic or an Amazon Auto Scaling policy.
+pmaOKActions :: Lens' PutMetricAlarm [Text]
+pmaOKActions = lens _pmaOKActions (\ s a -> s{_pmaOKActions = a}) . _Default . _Coerce;
--- | The arithmetic operation to use when comparing the specified 'Statistic' and 'Threshold'. The specified 'Statistic' value is used as the first operand.
-pmaComparisonOperator :: Lens' PutMetricAlarm ComparisonOperator
-pmaComparisonOperator =
- lens _pmaComparisonOperator (\s a -> s { _pmaComparisonOperator = a })
+-- | Indicates whether or not actions should be executed during any changes
+-- to the alarm\'s state.
+pmaActionsEnabled :: Lens' PutMetricAlarm (Maybe Bool)
+pmaActionsEnabled = lens _pmaActionsEnabled (\ s a -> s{_pmaActionsEnabled = a});
--- | The dimensions for the alarm's associated metric.
+-- | The list of actions to execute when this alarm transitions into an
+-- 'INSUFFICIENT_DATA' state from any other state. Each action is specified
+-- as an Amazon Resource Number (ARN). Currently the only action supported
+-- is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
+pmaInsufficientDataActions :: Lens' PutMetricAlarm [Text]
+pmaInsufficientDataActions = lens _pmaInsufficientDataActions (\ s a -> s{_pmaInsufficientDataActions = a}) . _Default . _Coerce;
+
+-- | The dimensions for the alarm\'s associated metric.
pmaDimensions :: Lens' PutMetricAlarm [Dimension]
-pmaDimensions = lens _pmaDimensions (\s a -> s { _pmaDimensions = a }) . _List
+pmaDimensions = lens _pmaDimensions (\ s a -> s{_pmaDimensions = a}) . _Default . _Coerce;
--- | The number of periods over which data is compared to the specified
--- threshold.
-pmaEvaluationPeriods :: Lens' PutMetricAlarm Natural
-pmaEvaluationPeriods =
- lens _pmaEvaluationPeriods (\s a -> s { _pmaEvaluationPeriods = a })
- . _Nat
+-- | The list of actions to execute when this alarm transitions into an
+-- 'ALARM' state from any other state. Each action is specified as an
+-- Amazon Resource Number (ARN). Currently the only action supported is
+-- publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
+pmaAlarmActions :: Lens' PutMetricAlarm [Text]
+pmaAlarmActions = lens _pmaAlarmActions (\ s a -> s{_pmaAlarmActions = a}) . _Default . _Coerce;
--- | The list of actions to execute when this alarm transitions into an 'INSUFFICIENT_DATA' state from any other state. Each action is specified as an Amazon Resource
--- Number (ARN). Currently the only action supported is publishing to an Amazon
--- SNS topic or an Amazon Auto Scaling policy.
-pmaInsufficientDataActions :: Lens' PutMetricAlarm [Text]
-pmaInsufficientDataActions =
- lens _pmaInsufficientDataActions
- (\s a -> s { _pmaInsufficientDataActions = a })
- . _List
+-- | The unit for the alarm\'s associated metric.
+pmaUnit :: Lens' PutMetricAlarm (Maybe StandardUnit)
+pmaUnit = lens _pmaUnit (\ s a -> s{_pmaUnit = a});
--- | The name for the alarm's associated metric.
+-- | The descriptive name for the alarm. This name must be unique within the
+-- user\'s AWS account
+pmaAlarmName :: Lens' PutMetricAlarm Text
+pmaAlarmName = lens _pmaAlarmName (\ s a -> s{_pmaAlarmName = a});
+
+-- | The name for the alarm\'s associated metric.
pmaMetricName :: Lens' PutMetricAlarm Text
-pmaMetricName = lens _pmaMetricName (\s a -> s { _pmaMetricName = a })
+pmaMetricName = lens _pmaMetricName (\ s a -> s{_pmaMetricName = a});
--- | The namespace for the alarm's associated metric.
+-- | The namespace for the alarm\'s associated metric.
pmaNamespace :: Lens' PutMetricAlarm Text
-pmaNamespace = lens _pmaNamespace (\s a -> s { _pmaNamespace = a })
+pmaNamespace = lens _pmaNamespace (\ s a -> s{_pmaNamespace = a});
--- | The list of actions to execute when this alarm transitions into an 'OK' state
--- from any other state. Each action is specified as an Amazon Resource Number
--- (ARN). Currently the only action supported is publishing to an Amazon SNS
--- topic or an Amazon Auto Scaling policy.
-pmaOKActions :: Lens' PutMetricAlarm [Text]
-pmaOKActions = lens _pmaOKActions (\s a -> s { _pmaOKActions = a }) . _List
+-- | The statistic to apply to the alarm\'s associated metric.
+pmaStatistic :: Lens' PutMetricAlarm Statistic
+pmaStatistic = lens _pmaStatistic (\ s a -> s{_pmaStatistic = a});
-- | The period in seconds over which the specified statistic is applied.
pmaPeriod :: Lens' PutMetricAlarm Natural
-pmaPeriod = lens _pmaPeriod (\s a -> s { _pmaPeriod = a }) . _Nat
+pmaPeriod = lens _pmaPeriod (\ s a -> s{_pmaPeriod = a}) . _Nat;
--- | The statistic to apply to the alarm's associated metric.
-pmaStatistic :: Lens' PutMetricAlarm Statistic
-pmaStatistic = lens _pmaStatistic (\s a -> s { _pmaStatistic = a })
+-- | The number of periods over which data is compared to the specified
+-- threshold.
+pmaEvaluationPeriods :: Lens' PutMetricAlarm Natural
+pmaEvaluationPeriods = lens _pmaEvaluationPeriods (\ s a -> s{_pmaEvaluationPeriods = a}) . _Nat;
-- | The value against which the specified statistic is compared.
pmaThreshold :: Lens' PutMetricAlarm Double
-pmaThreshold = lens _pmaThreshold (\s a -> s { _pmaThreshold = a })
+pmaThreshold = lens _pmaThreshold (\ s a -> s{_pmaThreshold = a});
--- | The unit for the alarm's associated metric.
-pmaUnit :: Lens' PutMetricAlarm (Maybe StandardUnit)
-pmaUnit = lens _pmaUnit (\s a -> s { _pmaUnit = a })
+-- | The arithmetic operation to use when comparing the specified 'Statistic'
+-- and 'Threshold'. The specified 'Statistic' value is used as the first
+-- operand.
+pmaComparisonOperator :: Lens' PutMetricAlarm ComparisonOperator
+pmaComparisonOperator = lens _pmaComparisonOperator (\ s a -> s{_pmaComparisonOperator = a});
-data PutMetricAlarmResponse = PutMetricAlarmResponse
- deriving (Eq, Ord, Read, Show, Generic)
+instance AWSRequest PutMetricAlarm where
+ type Sv PutMetricAlarm = CloudWatch
+ type Rs PutMetricAlarm = PutMetricAlarmResponse
+ request = postQuery
+ response = receiveNull PutMetricAlarmResponse'
--- | 'PutMetricAlarmResponse' constructor.
-putMetricAlarmResponse :: PutMetricAlarmResponse
-putMetricAlarmResponse = PutMetricAlarmResponse
+instance ToHeaders PutMetricAlarm where
+ toHeaders = const mempty
instance ToPath PutMetricAlarm where
- toPath = const "/"
+ toPath = const "/"
instance ToQuery PutMetricAlarm where
- toQuery PutMetricAlarm{..} = mconcat
- [ "ActionsEnabled" =? _pmaActionsEnabled
- , "AlarmActions" =? _pmaAlarmActions
- , "AlarmDescription" =? _pmaAlarmDescription
- , "AlarmName" =? _pmaAlarmName
- , "ComparisonOperator" =? _pmaComparisonOperator
- , "Dimensions" =? _pmaDimensions
- , "EvaluationPeriods" =? _pmaEvaluationPeriods
- , "InsufficientDataActions" =? _pmaInsufficientDataActions
- , "MetricName" =? _pmaMetricName
- , "Namespace" =? _pmaNamespace
- , "OKActions" =? _pmaOKActions
- , "Period" =? _pmaPeriod
- , "Statistic" =? _pmaStatistic
- , "Threshold" =? _pmaThreshold
- , "Unit" =? _pmaUnit
- ]
+ toQuery PutMetricAlarm'{..}
+ = mconcat
+ ["Action" =: ("PutMetricAlarm" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "AlarmDescription" =: _pmaAlarmDescription,
+ "OKActions" =:
+ toQuery (toQueryList "member" <$> _pmaOKActions),
+ "ActionsEnabled" =: _pmaActionsEnabled,
+ "InsufficientDataActions" =:
+ toQuery
+ (toQueryList "member" <$>
+ _pmaInsufficientDataActions),
+ "Dimensions" =:
+ toQuery (toQueryList "member" <$> _pmaDimensions),
+ "AlarmActions" =:
+ toQuery (toQueryList "member" <$> _pmaAlarmActions),
+ "Unit" =: _pmaUnit, "AlarmName" =: _pmaAlarmName,
+ "MetricName" =: _pmaMetricName,
+ "Namespace" =: _pmaNamespace,
+ "Statistic" =: _pmaStatistic, "Period" =: _pmaPeriod,
+ "EvaluationPeriods" =: _pmaEvaluationPeriods,
+ "Threshold" =: _pmaThreshold,
+ "ComparisonOperator" =: _pmaComparisonOperator]
-instance ToHeaders PutMetricAlarm
+-- | /See:/ 'putMetricAlarmResponse' smart constructor.
+data PutMetricAlarmResponse =
+ PutMetricAlarmResponse'
+ deriving (Eq,Read,Show,Data,Typeable,Generic)
-instance AWSRequest PutMetricAlarm where
- type Sv PutMetricAlarm = CloudWatch
- type Rs PutMetricAlarm = PutMetricAlarmResponse
-
- request = post "PutMetricAlarm"
- response = nullResponse PutMetricAlarmResponse
+-- | Creates a value of 'PutMetricAlarmResponse' with the minimum fields required to make a request.
+--
+putMetricAlarmResponse
+ :: PutMetricAlarmResponse
+putMetricAlarmResponse = PutMetricAlarmResponse'
diff --git a/gen/Network/AWS/CloudWatch/PutMetricData.hs b/gen/Network/AWS/CloudWatch/PutMetricData.hs
index 1c0edd9..2d667a6 100644
--- a/gen/Network/AWS/CloudWatch/PutMetricData.hs
+++ b/gen/Network/AWS/CloudWatch/PutMetricData.hs
@@ -1,113 +1,120 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.PutMetricData
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch
--- associates the data points with the specified metric. If the specified metric
--- does not exist, Amazon CloudWatch creates the metric. It can take up to
--- fifteen minutes for a new metric to appear in calls to the 'ListMetrics' action.
+-- Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch
+-- associates the data points with the specified metric. If the specified
+-- metric does not exist, Amazon CloudWatch creates the metric. It can take
+-- up to fifteen minutes for a new metric to appear in calls to the
+-- ListMetrics action.
--
-- The size of a PutMetricData request is limited to 8 KB for HTTP GET
-- requests and 40 KB for HTTP POST requests.
--
-- Although the 'Value' parameter accepts numbers of type 'Double', Amazon
--- CloudWatch truncates values with very large exponents. Values with base-10
--- exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with
--- base-10 exponents less than -130 (1 x 10^-130) are also truncated. Data that
--- is timestamped 24 hours or more in the past may take in excess of 48 hours to
--- become available from submission time using 'GetMetricStatistics'.
+-- CloudWatch truncates values with very large exponents. Values with
+-- base-10 exponents greater than 126 (1 x 10^126) are truncated. Likewise,
+-- values with base-10 exponents less than -130 (1 x 10^-130) are also
+-- truncated.
+--
+-- Data that is timestamped 24 hours or more in the past may take in excess
+-- of 48 hours to become available from submission time using
+-- 'GetMetricStatistics'.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html AWS API Reference> for PutMetricData.
module Network.AWS.CloudWatch.PutMetricData
(
- -- * Request
- PutMetricData
- -- ** Request constructor
- , putMetricData
- -- ** Request lenses
- , pmdMetricData
+ -- * Creating a Request
+ putMetricData
+ , PutMetricData
+ -- * Request Lenses
, pmdNamespace
+ , pmdMetricData
- -- * Response
- , PutMetricDataResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, putMetricDataResponse
+ , PutMetricDataResponse
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
-data PutMetricData = PutMetricData
- { _pmdMetricData :: List "member" MetricDatum
- , _pmdNamespace :: Text
- } deriving (Eq, Read, Show)
+-- | /See:/ 'putMetricData' smart constructor.
+data PutMetricData = PutMetricData'
+ { _pmdNamespace :: !Text
+ , _pmdMetricData :: ![MetricDatum]
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
--- | 'PutMetricData' constructor.
+-- | Creates a value of 'PutMetricData' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'pmdMetricData' @::@ ['MetricDatum']
+-- * 'pmdNamespace'
--
--- * 'pmdNamespace' @::@ 'Text'
---
-putMetricData :: Text -- ^ 'pmdNamespace'
- -> PutMetricData
-putMetricData p1 = PutMetricData
- { _pmdNamespace = p1
+-- * 'pmdMetricData'
+putMetricData
+ :: Text -- ^ 'pmdNamespace'
+ -> PutMetricData
+putMetricData pNamespace_ =
+ PutMetricData'
+ { _pmdNamespace = pNamespace_
, _pmdMetricData = mempty
}
--- | A list of data describing the metric.
-pmdMetricData :: Lens' PutMetricData [MetricDatum]
-pmdMetricData = lens _pmdMetricData (\s a -> s { _pmdMetricData = a }) . _List
-
-- | The namespace for the metric data.
pmdNamespace :: Lens' PutMetricData Text
-pmdNamespace = lens _pmdNamespace (\s a -> s { _pmdNamespace = a })
+pmdNamespace = lens _pmdNamespace (\ s a -> s{_pmdNamespace = a});
+
+-- | A list of data describing the metric.
+pmdMetricData :: Lens' PutMetricData [MetricDatum]
+pmdMetricData = lens _pmdMetricData (\ s a -> s{_pmdMetricData = a}) . _Coerce;
-data PutMetricDataResponse = PutMetricDataResponse
- deriving (Eq, Ord, Read, Show, Generic)
+instance AWSRequest PutMetricData where
+ type Sv PutMetricData = CloudWatch
+ type Rs PutMetricData = PutMetricDataResponse
+ request = postQuery
+ response = receiveNull PutMetricDataResponse'
--- | 'PutMetricDataResponse' constructor.
-putMetricDataResponse :: PutMetricDataResponse
-putMetricDataResponse = PutMetricDataResponse
+instance ToHeaders PutMetricData where
+ toHeaders = const mempty
instance ToPath PutMetricData where
- toPath = const "/"
+ toPath = const "/"
instance ToQuery PutMetricData where
- toQuery PutMetricData{..} = mconcat
- [ "MetricData" =? _pmdMetricData
- , "Namespace" =? _pmdNamespace
- ]
-
-instance ToHeaders PutMetricData
-
-instance AWSRequest PutMetricData where
- type Sv PutMetricData = CloudWatch
- type Rs PutMetricData = PutMetricDataResponse
-
- request = post "PutMetricData"
- response = nullResponse PutMetricDataResponse
+ toQuery PutMetricData'{..}
+ = mconcat
+ ["Action" =: ("PutMetricData" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "Namespace" =: _pmdNamespace,
+ "MetricData" =: toQueryList "member" _pmdMetricData]
+
+-- | /See:/ 'putMetricDataResponse' smart constructor.
+data PutMetricDataResponse =
+ PutMetricDataResponse'
+ deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'PutMetricDataResponse' with the minimum fields required to make a request.
+--
+putMetricDataResponse
+ :: PutMetricDataResponse
+putMetricDataResponse = PutMetricDataResponse'
diff --git a/gen/Network/AWS/CloudWatch/SetAlarmState.hs b/gen/Network/AWS/CloudWatch/SetAlarmState.hs
index 0311834..6dadc6b 100644
--- a/gen/Network/AWS/CloudWatch/SetAlarmState.hs
+++ b/gen/Network/AWS/CloudWatch/SetAlarmState.hs
@@ -1,129 +1,132 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
+{-# OPTIONS_GHC -fno-warn-unused-matches #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
-- Module : Network.AWS.CloudWatch.SetAlarmState
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
--- | Temporarily sets the state of an alarm. When the updated 'StateValue' differs
--- from the previous value, the action configured for the appropriate state is
--- invoked. This is not a permanent change. The next periodic alarm check (in
--- about a minute) will set the alarm to its actual state.
+-- Temporarily sets the state of an alarm. When the updated 'StateValue'
+-- differs from the previous value, the action configured for the
+-- appropriate state is invoked. This is not a permanent change. The next
+-- periodic alarm check (in about a minute) will set the alarm to its
+-- actual state.
--
--- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_SetAlarmState.html>
+-- /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_SetAlarmState.html AWS API Reference> for SetAlarmState.
module Network.AWS.CloudWatch.SetAlarmState
(
- -- * Request
- SetAlarmState
- -- ** Request constructor
- , setAlarmState
- -- ** Request lenses
- , sasAlarmName
- , sasStateReason
+ -- * Creating a Request
+ setAlarmState
+ , SetAlarmState
+ -- * Request Lenses
, sasStateReasonData
+ , sasAlarmName
, sasStateValue
+ , sasStateReason
- -- * Response
- , SetAlarmStateResponse
- -- ** Response constructor
+ -- * Destructuring the Response
, setAlarmStateResponse
+ , SetAlarmStateResponse
) where
-import Network.AWS.Prelude
-import Network.AWS.Request.Query
-import Network.AWS.CloudWatch.Types
-import qualified GHC.Exts
-
-data SetAlarmState = SetAlarmState
- { _sasAlarmName :: Text
- , _sasStateReason :: Text
- , _sasStateReasonData :: Maybe Text
- , _sasStateValue :: StateValue
- } deriving (Eq, Read, Show)
-
--- | 'SetAlarmState' constructor.
+import Network.AWS.CloudWatch.Types
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.Prelude
+import Network.AWS.Request
+import Network.AWS.Response
+
+-- | /See:/ 'setAlarmState' smart constructor.
+data SetAlarmState = SetAlarmState'
+ { _sasStateReasonData :: !(Maybe Text)
+ , _sasAlarmName :: !Text
+ , _sasStateValue :: !StateValue
+ , _sasStateReason :: !Text
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'SetAlarmState' with the minimum fields required to make a request.
--
--- The fields accessible through corresponding lenses are:
+-- Use one of the following lenses to modify other fields as desired:
--
--- * 'sasAlarmName' @::@ 'Text'
+-- * 'sasStateReasonData'
--
--- * 'sasStateReason' @::@ 'Text'
+-- * 'sasAlarmName'
--
--- * 'sasStateReasonData' @::@ 'Maybe' 'Text'
+-- * 'sasStateValue'
--
--- * 'sasStateValue' @::@ 'StateValue'
---
-setAlarmState :: Text -- ^ 'sasAlarmName'
- -> StateValue -- ^ 'sasStateValue'
- -> Text -- ^ 'sasStateReason'
- -> SetAlarmState
-setAlarmState p1 p2 p3 = SetAlarmState
- { _sasAlarmName = p1
- , _sasStateValue = p2
- , _sasStateReason = p3
- , _sasStateReasonData = Nothing
+-- * 'sasStateReason'
+setAlarmState
+ :: Text -- ^ 'sasAlarmName'
+ -> StateValue -- ^ 'sasStateValue'
+ -> Text -- ^ 'sasStateReason'
+ -> SetAlarmState
+setAlarmState pAlarmName_ pStateValue_ pStateReason_ =
+ SetAlarmState'
+ { _sasStateReasonData = Nothing
+ , _sasAlarmName = pAlarmName_
+ , _sasStateValue = pStateValue_
+ , _sasStateReason = pStateReason_
}
--- | The descriptive name for the alarm. This name must be unique within the
--- user's AWS account. The maximum length is 255 characters.
-sasAlarmName :: Lens' SetAlarmState Text
-sasAlarmName = lens _sasAlarmName (\s a -> s { _sasAlarmName = a })
-
--- | The reason that this alarm is set to this specific state (in human-readable
--- text format)
-sasStateReason :: Lens' SetAlarmState Text
-sasStateReason = lens _sasStateReason (\s a -> s { _sasStateReason = a })
-
-- | The reason that this alarm is set to this specific state (in
-- machine-readable JSON format)
sasStateReasonData :: Lens' SetAlarmState (Maybe Text)
-sasStateReasonData =
- lens _sasStateReasonData (\s a -> s { _sasStateReasonData = a })
+sasStateReasonData = lens _sasStateReasonData (\ s a -> s{_sasStateReasonData = a});
+
+-- | The descriptive name for the alarm. This name must be unique within the
+-- user\'s AWS account. The maximum length is 255 characters.
+sasAlarmName :: Lens' SetAlarmState Text
+sasAlarmName = lens _sasAlarmName (\ s a -> s{_sasAlarmName = a});
-- | The value of the state.
sasStateValue :: Lens' SetAlarmState StateValue
-sasStateValue = lens _sasStateValue (\s a -> s { _sasStateValue = a })
+sasStateValue = lens _sasStateValue (\ s a -> s{_sasStateValue = a});
-data SetAlarmStateResponse = SetAlarmStateResponse
- deriving (Eq, Ord, Read, Show, Generic)
+-- | The reason that this alarm is set to this specific state (in
+-- human-readable text format)
+sasStateReason :: Lens' SetAlarmState Text
+sasStateReason = lens _sasStateReason (\ s a -> s{_sasStateReason = a});
--- | 'SetAlarmStateResponse' constructor.
-setAlarmStateResponse :: SetAlarmStateResponse
-setAlarmStateResponse = SetAlarmStateResponse
+instance AWSRequest SetAlarmState where
+ type Sv SetAlarmState = CloudWatch
+ type Rs SetAlarmState = SetAlarmStateResponse
+ request = postQuery
+ response = receiveNull SetAlarmStateResponse'
+
+instance ToHeaders SetAlarmState where
+ toHeaders = const mempty
instance ToPath SetAlarmState where
- toPath = const "/"
+ toPath = const "/"
instance ToQuery SetAlarmState where
- toQuery SetAlarmState{..} = mconcat
- [ "AlarmName" =? _sasAlarmName
- , "StateReason" =? _sasStateReason
- , "StateReasonData" =? _sasStateReasonData
- , "StateValue" =? _sasStateValue
- ]
-
-instance ToHeaders SetAlarmState
-
-instance AWSRequest SetAlarmState where
- type Sv SetAlarmState = CloudWatch
- type Rs SetAlarmState = SetAlarmStateResponse
-
- request = post "SetAlarmState"
- response = nullResponse SetAlarmStateResponse
+ toQuery SetAlarmState'{..}
+ = mconcat
+ ["Action" =: ("SetAlarmState" :: ByteString),
+ "Version" =: ("2010-08-01" :: ByteString),
+ "StateReasonData" =: _sasStateReasonData,
+ "AlarmName" =: _sasAlarmName,
+ "StateValue" =: _sasStateValue,
+ "StateReason" =: _sasStateReason]
+
+-- | /See:/ 'setAlarmStateResponse' smart constructor.
+data SetAlarmStateResponse =
+ SetAlarmStateResponse'
+ deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'SetAlarmStateResponse' with the minimum fields required to make a request.
+--
+setAlarmStateResponse
+ :: SetAlarmStateResponse
+setAlarmStateResponse = SetAlarmStateResponse'
diff --git a/gen/Network/AWS/CloudWatch/Types.hs b/gen/Network/AWS/CloudWatch/Types.hs
index 000f1e1..2c99271 100644
--- a/gen/Network/AWS/CloudWatch/Types.hs
+++ b/gen/Network/AWS/CloudWatch/Types.hs
@@ -1,1111 +1,202 @@
-{-# LANGUAGE DataKinds #-}
-{-# LANGUAGE DeriveGeneric #-}
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE NoImplicitPrelude #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE RecordWildCards #-}
-{-# LANGUAGE TypeFamilies #-}
-{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TypeFamilies #-}
-{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+-- |
-- Module : Network.AWS.CloudWatch.Types
--- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
--- License : This Source Code Form is subject to the terms of
--- the Mozilla Public License, v. 2.0.
--- A copy of the MPL can be found in the LICENSE file or
--- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
--- Stability : experimental
+-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
--- Derived from AWS service descriptions, licensed under Apache 2.0.
-
module Network.AWS.CloudWatch.Types
(
-- * Service
CloudWatch
- -- ** Error
- , RESTError
- -- ** XML
- , ns
- -- * StatisticSet
- , StatisticSet
- , statisticSet
- , ssMaximum
- , ssMinimum
- , ssSampleCount
- , ssSum
+ -- * Errors
+ , _LimitExceededFault
+ , _InvalidNextToken
+ , _InternalServiceFault
+ , _InvalidParameterValueException
+ , _InvalidFormatFault
+ , _MissingRequiredParameterException
+ , _InvalidParameterCombinationException
+ , _ResourceNotFound
- -- * MetricAlarm
- , MetricAlarm
- , metricAlarm
- , maActionsEnabled
- , maAlarmActions
- , maAlarmArn
- , maAlarmConfigurationUpdatedTimestamp
- , maAlarmDescription
- , maAlarmName
- , maComparisonOperator
- , maDimensions
- , maEvaluationPeriods
- , maInsufficientDataActions
- , maMetricName
- , maNamespace
- , maOKActions
- , maPeriod
- , maStateReason
- , maStateReasonData
- , maStateUpdatedTimestamp
- , maStateValue
- , maStatistic
- , maThreshold
- , maUnit
+ -- * ComparisonOperator
+ , ComparisonOperator (..)
-- * HistoryItemType
, HistoryItemType (..)
- -- * MetricDatum
- , MetricDatum
- , metricDatum
- , mdDimensions
- , mdMetricName
- , mdStatisticValues
- , mdTimestamp
- , mdUnit
- , mdValue
-
-- * StandardUnit
, StandardUnit (..)
- -- * Dimension
- , Dimension
- , dimension
- , dName
- , dValue
+ -- * StateValue
+ , StateValue (..)
- -- * ComparisonOperator
- , ComparisonOperator (..)
+ -- * Statistic
+ , Statistic (..)
-- * AlarmHistoryItem
, AlarmHistoryItem
, alarmHistoryItem
, ahiAlarmName
- , ahiHistoryData
, ahiHistoryItemType
- , ahiHistorySummary
+ , ahiHistoryData
, ahiTimestamp
-
- -- * Metric
- , Metric
- , metric
- , mDimensions
- , mMetricName
- , mNamespace
-
- -- * StateValue
- , StateValue (..)
+ , ahiHistorySummary
-- * Datapoint
, Datapoint
, datapoint
- , dAverage
+ , dSampleCount
, dMaximum
+ , dAverage
, dMinimum
- , dSampleCount
, dSum
, dTimestamp
, dUnit
+ -- * Dimension
+ , Dimension
+ , dimension
+ , dName
+ , dValue
+
-- * DimensionFilter
, DimensionFilter
, dimensionFilter
- , dfName
, dfValue
+ , dfName
- -- * Statistic
- , Statistic (..)
+ -- * Metric
+ , Metric
+ , metric
+ , mMetricName
+ , mNamespace
+ , mDimensions
+
+ -- * MetricAlarm
+ , MetricAlarm
+ , metricAlarm
+ , maAlarmName
+ , maStateUpdatedTimestamp
+ , maAlarmDescription
+ , maPeriod
+ , maEvaluationPeriods
+ , maMetricName
+ , maNamespace
+ , maOKActions
+ , maComparisonOperator
+ , maStateValue
+ , maThreshold
+ , maActionsEnabled
+ , maAlarmConfigurationUpdatedTimestamp
+ , maInsufficientDataActions
+ , maDimensions
+ , maStateReasonData
+ , maStateReason
+ , maAlarmARN
+ , maAlarmActions
+ , maStatistic
+ , maUnit
+
+ -- * MetricDatum
+ , MetricDatum
+ , metricDatum
+ , mdValue
+ , mdDimensions
+ , mdTimestamp
+ , mdStatisticValues
+ , mdUnit
+ , mdMetricName
+
+ -- * StatisticSet
+ , StatisticSet
+ , statisticSet
+ , ssSampleCount
+ , ssSum
+ , ssMinimum
+ , ssMaximum
) where
-import Network.AWS.Prelude
-import Network.AWS.Signing
-import qualified GHC.Exts
+import Network.AWS.CloudWatch.Types.Product
+import Network.AWS.CloudWatch.Types.Sum
+import Network.AWS.Prelude
+import Network.AWS.Sign.V4
--- | Version @2010-08-01@ of the Amazon CloudWatch service.
+-- | Version @2010-08-01@ of the Amazon CloudWatch SDK.
data CloudWatch
instance AWSService CloudWatch where
type Sg CloudWatch = V4
- type Er CloudWatch = RESTError
-
- service = service'
+ service = const svc
where
- service' :: Service CloudWatch
- service' = Service
- { _svcAbbrev = "CloudWatch"
- , _svcPrefix = "monitoring"
- , _svcVersion = "2010-08-01"
- , _svcTargetPrefix = Nothing
- , _svcJSONVersion = Nothing
- , _svcHandle = handle
- , _svcRetry = retry
+ svc =
+ Service
+ { _svcAbbrev = "CloudWatch"
+ , _svcPrefix = "monitoring"
+ , _svcVersion = "2010-08-01"
+ , _svcEndpoint = defaultEndpoint svc
+ , _svcTimeout = Just 70
+ , _svcStatus = statusSuccess
+ , _svcError = parseXMLError
+ , _svcRetry = retry
}
-
- handle :: Status
- -> Maybe (LazyByteString -> ServiceError RESTError)
- handle = restError statusSuccess service'
-
- retry :: Retry CloudWatch
- retry = Exponential
- { _retryBase = 0.05
- , _retryGrowth = 2
+ retry =
+ Exponential
+ { _retryBase = 5.0e-2
+ , _retryGrowth = 2
, _retryAttempts = 5
- , _retryCheck = check
+ , _retryCheck = check
}
-
- check :: Status
- -> RESTError
- -> Bool
- check (statusCode -> s) (awsErrorCode -> e)
- | s == 400 && (Just "Throttling") == e = True -- Throttling
- | s == 500 = True -- General Server Error
- | s == 509 = True -- Limit Exceeded
- | s == 503 = True -- Service Unavailable
- | otherwise = False
-
-ns :: Text
-ns = "http://monitoring.amazonaws.com/doc/2010-08-01/"
-{-# INLINE ns #-}
-
-data StatisticSet = StatisticSet
- { _ssMaximum :: Double
- , _ssMinimum :: Double
- , _ssSampleCount :: Double
- , _ssSum :: Double
- } deriving (Eq, Ord, Read, Show)
-
--- | 'StatisticSet' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'ssMaximum' @::@ 'Double'
---
--- * 'ssMinimum' @::@ 'Double'
---
--- * 'ssSampleCount' @::@ 'Double'
---
--- * 'ssSum' @::@ 'Double'
---
-statisticSet :: Double -- ^ 'ssSampleCount'
- -> Double -- ^ 'ssSum'
- -> Double -- ^ 'ssMinimum'
- -> Double -- ^ 'ssMaximum'
- -> StatisticSet
-statisticSet p1 p2 p3 p4 = StatisticSet
- { _ssSampleCount = p1
- , _ssSum = p2
- , _ssMinimum = p3
- , _ssMaximum = p4
- }
-
--- | The maximum value of the sample set.
-ssMaximum :: Lens' StatisticSet Double
-ssMaximum = lens _ssMaximum (\s a -> s { _ssMaximum = a })
-
--- | The minimum value of the sample set.
-ssMinimum :: Lens' StatisticSet Double
-ssMinimum = lens _ssMinimum (\s a -> s { _ssMinimum = a })
-
--- | The number of samples used for the statistic set.
-ssSampleCount :: Lens' StatisticSet Double
-ssSampleCount = lens _ssSampleCount (\s a -> s { _ssSampleCount = a })
-
--- | The sum of values for the sample set.
-ssSum :: Lens' StatisticSet Double
-ssSum = lens _ssSum (\s a -> s { _ssSum = a })
-
-instance FromXML StatisticSet where
- parseXML x = StatisticSet
- <$> x .@ "Maximum"
- <*> x .@ "Minimum"
- <*> x .@ "SampleCount"
- <*> x .@ "Sum"
-
-instance ToQuery StatisticSet where
- toQuery StatisticSet{..} = mconcat
- [ "Maximum" =? _ssMaximum
- , "Minimum" =? _ssMinimum
- , "SampleCount" =? _ssSampleCount
- , "Sum" =? _ssSum
- ]
-
-data MetricAlarm = MetricAlarm
- { _maActionsEnabled :: Maybe Bool
- , _maAlarmActions :: List "member" Text
- , _maAlarmArn :: Maybe Text
- , _maAlarmConfigurationUpdatedTimestamp :: Maybe ISO8601
- , _maAlarmDescription :: Maybe Text
- , _maAlarmName :: Maybe Text
- , _maComparisonOperator :: Maybe ComparisonOperator
- , _maDimensions :: List "member" Dimension
- , _maEvaluationPeriods :: Maybe Nat
- , _maInsufficientDataActions :: List "member" Text
- , _maMetricName :: Maybe Text
- , _maNamespace :: Maybe Text
- , _maOKActions :: List "member" Text
- , _maPeriod :: Maybe Nat
- , _maStateReason :: Maybe Text
- , _maStateReasonData :: Maybe Text
- , _maStateUpdatedTimestamp :: Maybe ISO8601
- , _maStateValue :: Maybe StateValue
- , _maStatistic :: Maybe Statistic
- , _maThreshold :: Maybe Double
- , _maUnit :: Maybe StandardUnit
- } deriving (Eq, Read, Show)
-
--- | 'MetricAlarm' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'maActionsEnabled' @::@ 'Maybe' 'Bool'
---
--- * 'maAlarmActions' @::@ ['Text']
---
--- * 'maAlarmArn' @::@ 'Maybe' 'Text'
---
--- * 'maAlarmConfigurationUpdatedTimestamp' @::@ 'Maybe' 'UTCTime'
---
--- * 'maAlarmDescription' @::@ 'Maybe' 'Text'
---
--- * 'maAlarmName' @::@ 'Maybe' 'Text'
---
--- * 'maComparisonOperator' @::@ 'Maybe' 'ComparisonOperator'
---
--- * 'maDimensions' @::@ ['Dimension']
---
--- * 'maEvaluationPeriods' @::@ 'Maybe' 'Natural'
---
--- * 'maInsufficientDataActions' @::@ ['Text']
---
--- * 'maMetricName' @::@ 'Maybe' 'Text'
---
--- * 'maNamespace' @::@ 'Maybe' 'Text'
---
--- * 'maOKActions' @::@ ['Text']
---
--- * 'maPeriod' @::@ 'Maybe' 'Natural'
---
--- * 'maStateReason' @::@ 'Maybe' 'Text'
---
--- * 'maStateReasonData' @::@ 'Maybe' 'Text'
---
--- * 'maStateUpdatedTimestamp' @::@ 'Maybe' 'UTCTime'
---
--- * 'maStateValue' @::@ 'Maybe' 'StateValue'
---
--- * 'maStatistic' @::@ 'Maybe' 'Statistic'
---
--- * 'maThreshold' @::@ 'Maybe' 'Double'
---
--- * 'maUnit' @::@ 'Maybe' 'StandardUnit'
---
-metricAlarm :: MetricAlarm
-metricAlarm = MetricAlarm
- { _maAlarmName = Nothing
- , _maAlarmArn = Nothing
- , _maAlarmDescription = Nothing
- , _maAlarmConfigurationUpdatedTimestamp = Nothing
- , _maActionsEnabled = Nothing
- , _maOKActions = mempty
- , _maAlarmActions = mempty
- , _maInsufficientDataActions = mempty
- , _maStateValue = Nothing
- , _maStateReason = Nothing
- , _maStateReasonData = Nothing
- , _maStateUpdatedTimestamp = Nothing
- , _maMetricName = Nothing
- , _maNamespace = Nothing
- , _maStatistic = Nothing
- , _maDimensions = mempty
- , _maPeriod = Nothing
- , _maUnit = Nothing
- , _maEvaluationPeriods = Nothing
- , _maThreshold = Nothing
- , _maComparisonOperator = Nothing
- }
-
--- | Indicates whether actions should be executed during any changes to the
--- alarm's state.
-maActionsEnabled :: Lens' MetricAlarm (Maybe Bool)
-maActionsEnabled = lens _maActionsEnabled (\s a -> s { _maActionsEnabled = a })
-
--- | The list of actions to execute when this alarm transitions into an 'ALARM'
--- state from any other state. Each action is specified as an Amazon Resource
--- Number (ARN). Currently the only actions supported are publishing to an
--- Amazon SNS topic and triggering an Auto Scaling policy.
-maAlarmActions :: Lens' MetricAlarm [Text]
-maAlarmActions = lens _maAlarmActions (\s a -> s { _maAlarmActions = a }) . _List
-
--- | The Amazon Resource Name (ARN) of the alarm.
-maAlarmArn :: Lens' MetricAlarm (Maybe Text)
-maAlarmArn = lens _maAlarmArn (\s a -> s { _maAlarmArn = a })
-
--- | The time stamp of the last update to the alarm configuration. Amazon
--- CloudWatch uses Coordinated Universal Time (UTC) when returning time stamps,
--- which do not accommodate seasonal adjustments such as daylight savings time.
--- For more information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps> in the /Amazon CloudWatch Developer Guide/
--- .
-maAlarmConfigurationUpdatedTimestamp :: Lens' MetricAlarm (Maybe UTCTime)
-maAlarmConfigurationUpdatedTimestamp =
- lens _maAlarmConfigurationUpdatedTimestamp
- (\s a -> s { _maAlarmConfigurationUpdatedTimestamp = a })
- . mapping _Time
-
--- | The description for the alarm.
-maAlarmDescription :: Lens' MetricAlarm (Maybe Text)
-maAlarmDescription =
- lens _maAlarmDescription (\s a -> s { _maAlarmDescription = a })
-
--- | The name of the alarm.
-maAlarmName :: Lens' MetricAlarm (Maybe Text)
-maAlarmName = lens _maAlarmName (\s a -> s { _maAlarmName = a })
-
--- | The arithmetic operation to use when comparing the specified 'Statistic' and 'Threshold'. The specified 'Statistic' value is used as the first operand.
-maComparisonOperator :: Lens' MetricAlarm (Maybe ComparisonOperator)
-maComparisonOperator =
- lens _maComparisonOperator (\s a -> s { _maComparisonOperator = a })
-
--- | The list of dimensions associated with the alarm's associated metric.
-maDimensions :: Lens' MetricAlarm [Dimension]
-maDimensions = lens _maDimensions (\s a -> s { _maDimensions = a }) . _List
-
--- | The number of periods over which data is compared to the specified
--- threshold.
-maEvaluationPeriods :: Lens' MetricAlarm (Maybe Natural)
-maEvaluationPeriods =
- lens _maEvaluationPeriods (\s a -> s { _maEvaluationPeriods = a })
- . mapping _Nat
-
--- | The list of actions to execute when this alarm transitions into an 'INSUFFICIENT_DATA' state from any other state. Each action is specified as an Amazon Resource
--- Number (ARN). Currently the only actions supported are publishing to an
--- Amazon SNS topic or triggering an Auto Scaling policy.
---
--- The current WSDL lists this attribute as 'UnknownActions'.
-maInsufficientDataActions :: Lens' MetricAlarm [Text]
-maInsufficientDataActions =
- lens _maInsufficientDataActions
- (\s a -> s { _maInsufficientDataActions = a })
- . _List
-
--- | The name of the alarm's metric.
-maMetricName :: Lens' MetricAlarm (Maybe Text)
-maMetricName = lens _maMetricName (\s a -> s { _maMetricName = a })
-
--- | The namespace of alarm's associated metric.
-maNamespace :: Lens' MetricAlarm (Maybe Text)
-maNamespace = lens _maNamespace (\s a -> s { _maNamespace = a })
-
--- | The list of actions to execute when this alarm transitions into an 'OK' state
--- from any other state. Each action is specified as an Amazon Resource Number
--- (ARN). Currently the only actions supported are publishing to an Amazon SNS
--- topic and triggering an Auto Scaling policy.
-maOKActions :: Lens' MetricAlarm [Text]
-maOKActions = lens _maOKActions (\s a -> s { _maOKActions = a }) . _List
-
--- | The period in seconds over which the statistic is applied.
-maPeriod :: Lens' MetricAlarm (Maybe Natural)
-maPeriod = lens _maPeriod (\s a -> s { _maPeriod = a }) . mapping _Nat
-
--- | A human-readable explanation for the alarm's state.
-maStateReason :: Lens' MetricAlarm (Maybe Text)
-maStateReason = lens _maStateReason (\s a -> s { _maStateReason = a })
-
--- | An explanation for the alarm's state in machine-readable JSON format
-maStateReasonData :: Lens' MetricAlarm (Maybe Text)
-maStateReasonData =
- lens _maStateReasonData (\s a -> s { _maStateReasonData = a })
-
--- | The time stamp of the last update to the alarm's state. Amazon CloudWatch
--- uses Coordinated Universal Time (UTC) when returning time stamps, which do
--- not accommodate seasonal adjustments such as daylight savings time. For more
--- information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps> in the /Amazon CloudWatch Developer Guide/.
-maStateUpdatedTimestamp :: Lens' MetricAlarm (Maybe UTCTime)
-maStateUpdatedTimestamp =
- lens _maStateUpdatedTimestamp (\s a -> s { _maStateUpdatedTimestamp = a })
- . mapping _Time
-
--- | The state value for the alarm.
-maStateValue :: Lens' MetricAlarm (Maybe StateValue)
-maStateValue = lens _maStateValue (\s a -> s { _maStateValue = a })
-
--- | The statistic to apply to the alarm's associated metric.
-maStatistic :: Lens' MetricAlarm (Maybe Statistic)
-maStatistic = lens _maStatistic (\s a -> s { _maStatistic = a })
-
--- | The value against which the specified statistic is compared.
-maThreshold :: Lens' MetricAlarm (Maybe Double)
-maThreshold = lens _maThreshold (\s a -> s { _maThreshold = a })
-
--- | The unit of the alarm's associated metric.
-maUnit :: Lens' MetricAlarm (Maybe StandardUnit)
-maUnit = lens _maUnit (\s a -> s { _maUnit = a })
-
-instance FromXML MetricAlarm where
- parseXML x = MetricAlarm
- <$> x .@? "ActionsEnabled"
- <*> x .@? "AlarmActions" .!@ mempty
- <*> x .@? "AlarmArn"
- <*> x .@? "AlarmConfigurationUpdatedTimestamp"
- <*> x .@? "AlarmDescription"
- <*> x .@? "AlarmName"
- <*> x .@? "ComparisonOperator"
- <*> x .@? "Dimensions" .!@ mempty
- <*> x .@? "EvaluationPeriods"
- <*> x .@? "InsufficientDataActions" .!@ mempty
- <*> x .@? "MetricName"
- <*> x .@? "Namespace"
- <*> x .@? "OKActions" .!@ mempty
- <*> x .@? "Period"
- <*> x .@? "StateReason"
- <*> x .@? "StateReasonData"
- <*> x .@? "StateUpdatedTimestamp"
- <*> x .@? "StateValue"
- <*> x .@? "Statistic"
- <*> x .@? "Threshold"
- <*> x .@? "Unit"
-
-instance ToQuery MetricAlarm where
- toQuery MetricAlarm{..} = mconcat
- [ "ActionsEnabled" =? _maActionsEnabled
- , "AlarmActions" =? _maAlarmActions
- , "AlarmArn" =? _maAlarmArn
- , "AlarmConfigurationUpdatedTimestamp" =? _maAlarmConfigurationUpdatedTimestamp
- , "AlarmDescription" =? _maAlarmDescription
- , "AlarmName" =? _maAlarmName
- , "ComparisonOperator" =? _maComparisonOperator
- , "Dimensions" =? _maDimensions
- , "EvaluationPeriods" =? _maEvaluationPeriods
- , "InsufficientDataActions" =? _maInsufficientDataActions
- , "MetricName" =? _maMetricName
- , "Namespace" =? _maNamespace
- , "OKActions" =? _maOKActions
- , "Period" =? _maPeriod
- , "StateReason" =? _maStateReason
- , "StateReasonData" =? _maStateReasonData
- , "StateUpdatedTimestamp" =? _maStateUpdatedTimestamp
- , "StateValue" =? _maStateValue
- , "Statistic" =? _maStatistic
- , "Threshold" =? _maThreshold
- , "Unit" =? _maUnit
- ]
-
-data HistoryItemType
- = Action -- ^ Action
- | ConfigurationUpdate -- ^ ConfigurationUpdate
- | StateUpdate -- ^ StateUpdate
- deriving (Eq, Ord, Read, Show, Generic, Enum)
-
-instance Hashable HistoryItemType
-
-instance FromText HistoryItemType where
- parser = takeLowerText >>= \case
- "action" -> pure Action
- "configurationupdate" -> pure ConfigurationUpdate
- "stateupdate" -> pure StateUpdate
- e -> fail $
- "Failure parsing HistoryItemType from " ++ show e
-
-instance ToText HistoryItemType where
- toText = \case
- Action -> "Action"
- ConfigurationUpdate -> "ConfigurationUpdate"
- StateUpdate -> "StateUpdate"
-
-instance ToByteString HistoryItemType
-instance ToHeader HistoryItemType
-instance ToQuery HistoryItemType
-
-instance FromXML HistoryItemType where
- parseXML = parseXMLText "HistoryItemType"
-
-data MetricDatum = MetricDatum
- { _mdDimensions :: List "member" Dimension
- , _mdMetricName :: Text
- , _mdStatisticValues :: Maybe StatisticSet
- , _mdTimestamp :: Maybe ISO8601
- , _mdUnit :: Maybe StandardUnit
- , _mdValue :: Maybe Double
- } deriving (Eq, Read, Show)
-
--- | 'MetricDatum' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'mdDimensions' @::@ ['Dimension']
---
--- * 'mdMetricName' @::@ 'Text'
---
--- * 'mdStatisticValues' @::@ 'Maybe' 'StatisticSet'
---
--- * 'mdTimestamp' @::@ 'Maybe' 'UTCTime'
---
--- * 'mdUnit' @::@ 'Maybe' 'StandardUnit'
---
--- * 'mdValue' @::@ 'Maybe' 'Double'
---
-metricDatum :: Text -- ^ 'mdMetricName'
- -> MetricDatum
-metricDatum p1 = MetricDatum
- { _mdMetricName = p1
- , _mdDimensions = mempty
- , _mdTimestamp = Nothing
- , _mdValue = Nothing
- , _mdStatisticValues = Nothing
- , _mdUnit = Nothing
- }
-
--- | A list of dimensions associated with the metric. Note, when using the
--- Dimensions value in a query, you need to append .member.N to it (e.g.,
--- Dimensions.member.N).
-mdDimensions :: Lens' MetricDatum [Dimension]
-mdDimensions = lens _mdDimensions (\s a -> s { _mdDimensions = a }) . _List
-
--- | The name of the metric.
-mdMetricName :: Lens' MetricDatum Text
-mdMetricName = lens _mdMetricName (\s a -> s { _mdMetricName = a })
-
--- | A set of statistical values describing the metric.
-mdStatisticValues :: Lens' MetricDatum (Maybe StatisticSet)
-mdStatisticValues =
- lens _mdStatisticValues (\s a -> s { _mdStatisticValues = a })
-
--- | The time stamp used for the metric. If not specified, the default value is
--- set to the time the metric data was received. Amazon CloudWatch uses
--- Coordinated Universal Time (UTC) when returning time stamps, which do not
--- accommodate seasonal adjustments such as daylight savings time. For more
--- information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps> in the /Amazon CloudWatch Developer Guide/.
-mdTimestamp :: Lens' MetricDatum (Maybe UTCTime)
-mdTimestamp = lens _mdTimestamp (\s a -> s { _mdTimestamp = a }) . mapping _Time
-
--- | The unit of the metric.
-mdUnit :: Lens' MetricDatum (Maybe StandardUnit)
-mdUnit = lens _mdUnit (\s a -> s { _mdUnit = a })
-
--- | The value for the metric.
---
--- Although the 'Value' parameter accepts numbers of type 'Double', Amazon
--- CloudWatch truncates values with very large exponents. Values with base-10
--- exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with
--- base-10 exponents less than -130 (1 x 10^-130) are also truncated.
-mdValue :: Lens' MetricDatum (Maybe Double)
-mdValue = lens _mdValue (\s a -> s { _mdValue = a })
-
-instance FromXML MetricDatum where
- parseXML x = MetricDatum
- <$> x .@? "Dimensions" .!@ mempty
- <*> x .@ "MetricName"
- <*> x .@? "StatisticValues"
- <*> x .@? "Timestamp"
- <*> x .@? "Unit"
- <*> x .@? "Value"
-
-instance ToQuery MetricDatum where
- toQuery MetricDatum{..} = mconcat
- [ "Dimensions" =? _mdDimensions
- , "MetricName" =? _mdMetricName
- , "StatisticValues" =? _mdStatisticValues
- , "Timestamp" =? _mdTimestamp
- , "Unit" =? _mdUnit
- , "Value" =? _mdValue
- ]
-
-data StandardUnit
- = Bits -- ^ Bits
- | BitsSecond -- ^ Bits/Second
- | Bytes -- ^ Bytes
- | BytesSecond -- ^ Bytes/Second
- | Count -- ^ Count
- | CountSecond -- ^ Count/Second
- | Gigabits -- ^ Gigabits
- | GigabitsSecond -- ^ Gigabits/Second
- | Gigabytes -- ^ Gigabytes
- | GigabytesSecond -- ^ Gigabytes/Second
- | Kilobits -- ^ Kilobits
- | KilobitsSecond -- ^ Kilobits/Second
- | Kilobytes -- ^ Kilobytes
- | KilobytesSecond -- ^ Kilobytes/Second
- | Megabits -- ^ Megabits
- | MegabitsSecond -- ^ Megabits/Second
- | Megabytes -- ^ Megabytes
- | MegabytesSecond -- ^ Megabytes/Second
- | Microseconds -- ^ Microseconds
- | Milliseconds -- ^ Milliseconds
- | None -- ^ None
- | Percent -- ^ Percent
- | Seconds -- ^ Seconds
- | Terabits -- ^ Terabits
- | TerabitsSecond -- ^ Terabits/Second
- | Terabytes -- ^ Terabytes
- | TerabytesSecond -- ^ Terabytes/Second
- deriving (Eq, Ord, Read, Show, Generic, Enum)
-
-instance Hashable StandardUnit
-
-instance FromText StandardUnit where
- parser = takeLowerText >>= \case
- "bits" -> pure Bits
- "bits/second" -> pure BitsSecond
- "bytes" -> pure Bytes
- "bytes/second" -> pure BytesSecond
- "count" -> pure Count
- "count/second" -> pure CountSecond
- "gigabits" -> pure Gigabits
- "gigabits/second" -> pure GigabitsSecond
- "gigabytes" -> pure Gigabytes
- "gigabytes/second" -> pure GigabytesSecond
- "kilobits" -> pure Kilobits
- "kilobits/second" -> pure KilobitsSecond
- "kilobytes" -> pure Kilobytes
- "kilobytes/second" -> pure KilobytesSecond
- "megabits" -> pure Megabits
- "megabits/second" -> pure MegabitsSecond
- "megabytes" -> pure Megabytes
- "megabytes/second" -> pure MegabytesSecond
- "microseconds" -> pure Microseconds
- "milliseconds" -> pure Milliseconds
- "none" -> pure None
- "percent" -> pure Percent
- "seconds" -> pure Seconds
- "terabits" -> pure Terabits
- "terabits/second" -> pure TerabitsSecond
- "terabytes" -> pure Terabytes
- "terabytes/second" -> pure TerabytesSecond
- e -> fail $
- "Failure parsing StandardUnit from " ++ show e
-
-instance ToText StandardUnit where
- toText = \case
- Bits -> "Bits"
- BitsSecond -> "Bits/Second"
- Bytes -> "Bytes"
- BytesSecond -> "Bytes/Second"
- Count -> "Count"
- CountSecond -> "Count/Second"
- Gigabits -> "Gigabits"
- GigabitsSecond -> "Gigabits/Second"
- Gigabytes -> "Gigabytes"
- GigabytesSecond -> "Gigabytes/Second"
- Kilobits -> "Kilobits"
- KilobitsSecond -> "Kilobits/Second"
- Kilobytes -> "Kilobytes"
- KilobytesSecond -> "Kilobytes/Second"
- Megabits -> "Megabits"
- MegabitsSecond -> "Megabits/Second"
- Megabytes -> "Megabytes"
- MegabytesSecond -> "Megabytes/Second"
- Microseconds -> "Microseconds"
- Milliseconds -> "Milliseconds"
- None -> "None"
- Percent -> "Percent"
- Seconds -> "Seconds"
- Terabits -> "Terabits"
- TerabitsSecond -> "Terabits/Second"
- Terabytes -> "Terabytes"
- TerabytesSecond -> "Terabytes/Second"
-
-instance ToByteString StandardUnit
-instance ToHeader StandardUnit
-instance ToQuery StandardUnit
-
-instance FromXML StandardUnit where
- parseXML = parseXMLText "StandardUnit"
-
-data Dimension = Dimension
- { _dName :: Text
- , _dValue :: Text
- } deriving (Eq, Ord, Read, Show)
-
--- | 'Dimension' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'dName' @::@ 'Text'
---
--- * 'dValue' @::@ 'Text'
---
-dimension :: Text -- ^ 'dName'
- -> Text -- ^ 'dValue'
- -> Dimension
-dimension p1 p2 = Dimension
- { _dName = p1
- , _dValue = p2
- }
-
--- | The name of the dimension.
-dName :: Lens' Dimension Text
-dName = lens _dName (\s a -> s { _dName = a })
-
--- | The value representing the dimension measurement
-dValue :: Lens' Dimension Text
-dValue = lens _dValue (\s a -> s { _dValue = a })
-
-instance FromXML Dimension where
- parseXML x = Dimension
- <$> x .@ "Name"
- <*> x .@ "Value"
-
-instance ToQuery Dimension where
- toQuery Dimension{..} = mconcat
- [ "Name" =? _dName
- , "Value" =? _dValue
- ]
-
-data ComparisonOperator
- = GreaterThanOrEqualToThreshold -- ^ GreaterThanOrEqualToThreshold
- | GreaterThanThreshold -- ^ GreaterThanThreshold
- | LessThanOrEqualToThreshold -- ^ LessThanOrEqualToThreshold
- | LessThanThreshold -- ^ LessThanThreshold
- deriving (Eq, Ord, Read, Show, Generic, Enum)
-
-instance Hashable ComparisonOperator
-
-instance FromText ComparisonOperator where
- parser = takeLowerText >>= \case
- "greaterthanorequaltothreshold" -> pure GreaterThanOrEqualToThreshold
- "greaterthanthreshold" -> pure GreaterThanThreshold
- "lessthanorequaltothreshold" -> pure LessThanOrEqualToThreshold
- "lessthanthreshold" -> pure LessThanThreshold
- e -> fail $
- "Failure parsing ComparisonOperator from " ++ show e
-
-instance ToText ComparisonOperator where
- toText = \case
- GreaterThanOrEqualToThreshold -> "GreaterThanOrEqualToThreshold"
- GreaterThanThreshold -> "GreaterThanThreshold"
- LessThanOrEqualToThreshold -> "LessThanOrEqualToThreshold"
- LessThanThreshold -> "LessThanThreshold"
-
-instance ToByteString ComparisonOperator
-instance ToHeader ComparisonOperator
-instance ToQuery ComparisonOperator
-
-instance FromXML ComparisonOperator where
- parseXML = parseXMLText "ComparisonOperator"
-
-data AlarmHistoryItem = AlarmHistoryItem
- { _ahiAlarmName :: Maybe Text
- , _ahiHistoryData :: Maybe Text
- , _ahiHistoryItemType :: Maybe HistoryItemType
- , _ahiHistorySummary :: Maybe Text
- , _ahiTimestamp :: Maybe ISO8601
- } deriving (Eq, Read, Show)
-
--- | 'AlarmHistoryItem' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'ahiAlarmName' @::@ 'Maybe' 'Text'
---
--- * 'ahiHistoryData' @::@ 'Maybe' 'Text'
---
--- * 'ahiHistoryItemType' @::@ 'Maybe' 'HistoryItemType'
---
--- * 'ahiHistorySummary' @::@ 'Maybe' 'Text'
---
--- * 'ahiTimestamp' @::@ 'Maybe' 'UTCTime'
---
-alarmHistoryItem :: AlarmHistoryItem
-alarmHistoryItem = AlarmHistoryItem
- { _ahiAlarmName = Nothing
- , _ahiTimestamp = Nothing
- , _ahiHistoryItemType = Nothing
- , _ahiHistorySummary = Nothing
- , _ahiHistoryData = Nothing
- }
-
--- | The descriptive name for the alarm.
-ahiAlarmName :: Lens' AlarmHistoryItem (Maybe Text)
-ahiAlarmName = lens _ahiAlarmName (\s a -> s { _ahiAlarmName = a })
-
--- | Machine-readable data about the alarm in JSON format.
-ahiHistoryData :: Lens' AlarmHistoryItem (Maybe Text)
-ahiHistoryData = lens _ahiHistoryData (\s a -> s { _ahiHistoryData = a })
-
--- | The type of alarm history item.
-ahiHistoryItemType :: Lens' AlarmHistoryItem (Maybe HistoryItemType)
-ahiHistoryItemType =
- lens _ahiHistoryItemType (\s a -> s { _ahiHistoryItemType = a })
-
--- | A human-readable summary of the alarm history.
-ahiHistorySummary :: Lens' AlarmHistoryItem (Maybe Text)
-ahiHistorySummary =
- lens _ahiHistorySummary (\s a -> s { _ahiHistorySummary = a })
-
--- | The time stamp for the alarm history item. Amazon CloudWatch uses
--- Coordinated Universal Time (UTC) when returning time stamps, which do not
--- accommodate seasonal adjustments such as daylight savings time. For more
--- information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps> in the /Amazon CloudWatch Developer Guide/.
-ahiTimestamp :: Lens' AlarmHistoryItem (Maybe UTCTime)
-ahiTimestamp = lens _ahiTimestamp (\s a -> s { _ahiTimestamp = a }) . mapping _Time
-
-instance FromXML AlarmHistoryItem where
- parseXML x = AlarmHistoryItem
- <$> x .@? "AlarmName"
- <*> x .@? "HistoryData"
- <*> x .@? "HistoryItemType"
- <*> x .@? "HistorySummary"
- <*> x .@? "Timestamp"
-
-instance ToQuery AlarmHistoryItem where
- toQuery AlarmHistoryItem{..} = mconcat
- [ "AlarmName" =? _ahiAlarmName
- , "HistoryData" =? _ahiHistoryData
- , "HistoryItemType" =? _ahiHistoryItemType
- , "HistorySummary" =? _ahiHistorySummary
- , "Timestamp" =? _ahiTimestamp
- ]
-
-data Metric = Metric
- { _mDimensions :: List "member" Dimension
- , _mMetricName :: Maybe Text
- , _mNamespace :: Maybe Text
- } deriving (Eq, Read, Show)
-
--- | 'Metric' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'mDimensions' @::@ ['Dimension']
---
--- * 'mMetricName' @::@ 'Maybe' 'Text'
---
--- * 'mNamespace' @::@ 'Maybe' 'Text'
---
-metric :: Metric
-metric = Metric
- { _mNamespace = Nothing
- , _mMetricName = Nothing
- , _mDimensions = mempty
- }
-
--- | A list of dimensions associated with the metric.
-mDimensions :: Lens' Metric [Dimension]
-mDimensions = lens _mDimensions (\s a -> s { _mDimensions = a }) . _List
-
--- | The name of the metric.
-mMetricName :: Lens' Metric (Maybe Text)
-mMetricName = lens _mMetricName (\s a -> s { _mMetricName = a })
-
--- | The namespace of the metric.
-mNamespace :: Lens' Metric (Maybe Text)
-mNamespace = lens _mNamespace (\s a -> s { _mNamespace = a })
-
-instance FromXML Metric where
- parseXML x = Metric
- <$> x .@? "Dimensions" .!@ mempty
- <*> x .@? "MetricName"
- <*> x .@? "Namespace"
-
-instance ToQuery Metric where
- toQuery Metric{..} = mconcat
- [ "Dimensions" =? _mDimensions
- , "MetricName" =? _mMetricName
- , "Namespace" =? _mNamespace
- ]
-
-data StateValue
- = Alarm -- ^ ALARM
- | InsufficientData -- ^ INSUFFICIENT_DATA
- | Ok -- ^ OK
- deriving (Eq, Ord, Read, Show, Generic, Enum)
-
-instance Hashable StateValue
-
-instance FromText StateValue where
- parser = takeLowerText >>= \case
- "alarm" -> pure Alarm
- "insufficient_data" -> pure InsufficientData
- "ok" -> pure Ok
- e -> fail $
- "Failure parsing StateValue from " ++ show e
-
-instance ToText StateValue where
- toText = \case
- Alarm -> "ALARM"
- InsufficientData -> "INSUFFICIENT_DATA"
- Ok -> "OK"
-
-instance ToByteString StateValue
-instance ToHeader StateValue
-instance ToQuery StateValue
-
-instance FromXML StateValue where
- parseXML = parseXMLText "StateValue"
-
-data Datapoint = Datapoint
- { _dAverage :: Maybe Double
- , _dMaximum :: Maybe Double
- , _dMinimum :: Maybe Double
- , _dSampleCount :: Maybe Double
- , _dSum :: Maybe Double
- , _dTimestamp :: Maybe ISO8601
- , _dUnit :: Maybe StandardUnit
- } deriving (Eq, Read, Show)
-
--- | 'Datapoint' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'dAverage' @::@ 'Maybe' 'Double'
---
--- * 'dMaximum' @::@ 'Maybe' 'Double'
---
--- * 'dMinimum' @::@ 'Maybe' 'Double'
---
--- * 'dSampleCount' @::@ 'Maybe' 'Double'
---
--- * 'dSum' @::@ 'Maybe' 'Double'
---
--- * 'dTimestamp' @::@ 'Maybe' 'UTCTime'
---
--- * 'dUnit' @::@ 'Maybe' 'StandardUnit'
---
-datapoint :: Datapoint
-datapoint = Datapoint
- { _dTimestamp = Nothing
- , _dSampleCount = Nothing
- , _dAverage = Nothing
- , _dSum = Nothing
- , _dMinimum = Nothing
- , _dMaximum = Nothing
- , _dUnit = Nothing
- }
-
--- | The average of metric values that correspond to the datapoint.
-dAverage :: Lens' Datapoint (Maybe Double)
-dAverage = lens _dAverage (\s a -> s { _dAverage = a })
-
--- | The maximum of the metric value used for the datapoint.
-dMaximum :: Lens' Datapoint (Maybe Double)
-dMaximum = lens _dMaximum (\s a -> s { _dMaximum = a })
-
--- | The minimum metric value used for the datapoint.
-dMinimum :: Lens' Datapoint (Maybe Double)
-dMinimum = lens _dMinimum (\s a -> s { _dMinimum = a })
-
--- | The number of metric values that contributed to the aggregate value of this
--- datapoint.
-dSampleCount :: Lens' Datapoint (Maybe Double)
-dSampleCount = lens _dSampleCount (\s a -> s { _dSampleCount = a })
-
--- | The sum of metric values used for the datapoint.
-dSum :: Lens' Datapoint (Maybe Double)
-dSum = lens _dSum (\s a -> s { _dSum = a })
-
--- | The time stamp used for the datapoint. Amazon CloudWatch uses Coordinated
--- Universal Time (UTC) when returning time stamps, which do not accommodate
--- seasonal adjustments such as daylight savings time. For more information, see <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps> in the /Amazon CloudWatch Developer Guide/.
-dTimestamp :: Lens' Datapoint (Maybe UTCTime)
-dTimestamp = lens _dTimestamp (\s a -> s { _dTimestamp = a }) . mapping _Time
-
--- | The standard unit used for the datapoint.
-dUnit :: Lens' Datapoint (Maybe StandardUnit)
-dUnit = lens _dUnit (\s a -> s { _dUnit = a })
-
-instance FromXML Datapoint where
- parseXML x = Datapoint
- <$> x .@? "Average"
- <*> x .@? "Maximum"
- <*> x .@? "Minimum"
- <*> x .@? "SampleCount"
- <*> x .@? "Sum"
- <*> x .@? "Timestamp"
- <*> x .@? "Unit"
-
-instance ToQuery Datapoint where
- toQuery Datapoint{..} = mconcat
- [ "Average" =? _dAverage
- , "Maximum" =? _dMaximum
- , "Minimum" =? _dMinimum
- , "SampleCount" =? _dSampleCount
- , "Sum" =? _dSum
- , "Timestamp" =? _dTimestamp
- , "Unit" =? _dUnit
- ]
-
-data DimensionFilter = DimensionFilter
- { _dfName :: Text
- , _dfValue :: Maybe Text
- } deriving (Eq, Ord, Read, Show)
-
--- | 'DimensionFilter' constructor.
---
--- The fields accessible through corresponding lenses are:
---
--- * 'dfName' @::@ 'Text'
---
--- * 'dfValue' @::@ 'Maybe' 'Text'
---
-dimensionFilter :: Text -- ^ 'dfName'
- -> DimensionFilter
-dimensionFilter p1 = DimensionFilter
- { _dfName = p1
- , _dfValue = Nothing
- }
-
--- | The dimension name to be matched.
-dfName :: Lens' DimensionFilter Text
-dfName = lens _dfName (\s a -> s { _dfName = a })
-
--- | The value of the dimension to be matched.
-dfValue :: Lens' DimensionFilter (Maybe Text)
-dfValue = lens _dfValue (\s a -> s { _dfValue = a })
-
-instance FromXML DimensionFilter where
- parseXML x = DimensionFilter
- <$> x .@ "Name"
- <*> x .@? "Value"
-
-instance ToQuery DimensionFilter where
- toQuery DimensionFilter{..} = mconcat
- [ "Name" =? _dfName
- , "Value" =? _dfValue
- ]
-
-data Statistic
- = Average -- ^ Average
- | Maximum -- ^ Maximum
- | Minimum -- ^ Minimum
- | SampleCount -- ^ SampleCount
- | Sum -- ^ Sum
- deriving (Eq, Ord, Read, Show, Generic, Enum)
-
-instance Hashable Statistic
-
-instance FromText Statistic where
- parser = takeLowerText >>= \case
- "average" -> pure Average
- "maximum" -> pure Maximum
- "minimum" -> pure Minimum
- "samplecount" -> pure SampleCount
- "sum" -> pure Sum
- e -> fail $
- "Failure parsing Statistic from " ++ show e
-
-instance ToText Statistic where
- toText = \case
- Average -> "Average"
- Maximum -> "Maximum"
- Minimum -> "Minimum"
- SampleCount -> "SampleCount"
- Sum -> "Sum"
-
-instance ToByteString Statistic
-instance ToHeader Statistic
-instance ToQuery Statistic
-
-instance FromXML Statistic where
- parseXML = parseXMLText "Statistic"
+ check e
+ | has (hasCode "ThrottlingException" . hasStatus 400) e =
+ Just "throttling_exception"
+ | has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
+ | has (hasStatus 503) e = Just "service_unavailable"
+ | has (hasStatus 500) e = Just "general_server_error"
+ | has (hasStatus 509) e = Just "limit_exceeded"
+ | otherwise = Nothing
+
+-- | The quota for alarms for this customer has already been reached.
+_LimitExceededFault :: AsError a => Getting (First ServiceError) a ServiceError
+_LimitExceededFault = _ServiceError . hasStatus 400 . hasCode "LimitExceeded"
+
+-- | The next token specified is invalid.
+_InvalidNextToken :: AsError a => Getting (First ServiceError) a ServiceError
+_InvalidNextToken = _ServiceError . hasStatus 400 . hasCode "InvalidNextToken"
+
+-- | Indicates that the request processing has failed due to some unknown
+-- error, exception, or failure.
+_InternalServiceFault :: AsError a => Getting (First ServiceError) a ServiceError
+_InternalServiceFault =
+ _ServiceError . hasStatus 500 . hasCode "InternalServiceError"
+
+-- | Bad or out-of-range value was supplied for the input parameter.
+_InvalidParameterValueException :: AsError a => Getting (First ServiceError) a ServiceError
+_InvalidParameterValueException =
+ _ServiceError . hasStatus 400 . hasCode "InvalidParameterValue"
+
+-- | Data was not syntactically valid JSON.
+_InvalidFormatFault :: AsError a => Getting (First ServiceError) a ServiceError
+_InvalidFormatFault = _ServiceError . hasStatus 400 . hasCode "InvalidFormat"
+
+-- | An input parameter that is mandatory for processing the request is not
+-- supplied.
+_MissingRequiredParameterException :: AsError a => Getting (First ServiceError) a ServiceError
+_MissingRequiredParameterException =
+ _ServiceError . hasStatus 400 . hasCode "MissingParameter"
+
+-- | Parameters that must not be used together were used together.
+_InvalidParameterCombinationException :: AsError a => Getting (First ServiceError) a ServiceError
+_InvalidParameterCombinationException =
+ _ServiceError . hasStatus 400 . hasCode "InvalidParameterCombination"
+
+-- | The named resource does not exist.
+_ResourceNotFound :: AsError a => Getting (First ServiceError) a ServiceError
+_ResourceNotFound = _ServiceError . hasStatus 404 . hasCode "ResourceNotFound"
diff --git a/gen/Network/AWS/CloudWatch/Types/Product.hs b/gen/Network/AWS/CloudWatch/Types/Product.hs
new file mode 100644
index 0000000..ac07307
--- /dev/null
+++ b/gen/Network/AWS/CloudWatch/Types/Product.hs
@@ -0,0 +1,705 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE TypeFamilies #-}
+
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
+-- Module : Network.AWS.CloudWatch.Types.Product
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : auto-generated
+-- Portability : non-portable (GHC extensions)
+--
+module Network.AWS.CloudWatch.Types.Product where
+
+import Network.AWS.CloudWatch.Types.Sum
+import Network.AWS.Prelude
+
+-- | The 'AlarmHistoryItem' data type contains descriptive information about
+-- the history of a specific alarm. If you call DescribeAlarmHistory,
+-- Amazon CloudWatch returns this data type as part of the
+-- DescribeAlarmHistoryResult data type.
+--
+-- /See:/ 'alarmHistoryItem' smart constructor.
+data AlarmHistoryItem = AlarmHistoryItem'
+ { _ahiAlarmName :: !(Maybe Text)
+ , _ahiHistoryItemType :: !(Maybe HistoryItemType)
+ , _ahiHistoryData :: !(Maybe Text)
+ , _ahiTimestamp :: !(Maybe ISO8601)
+ , _ahiHistorySummary :: !(Maybe Text)
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'AlarmHistoryItem' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'ahiAlarmName'
+--
+-- * 'ahiHistoryItemType'
+--
+-- * 'ahiHistoryData'
+--
+-- * 'ahiTimestamp'
+--
+-- * 'ahiHistorySummary'
+alarmHistoryItem
+ :: AlarmHistoryItem
+alarmHistoryItem =
+ AlarmHistoryItem'
+ { _ahiAlarmName = Nothing
+ , _ahiHistoryItemType = Nothing
+ , _ahiHistoryData = Nothing
+ , _ahiTimestamp = Nothing
+ , _ahiHistorySummary = Nothing
+ }
+
+-- | The descriptive name for the alarm.
+ahiAlarmName :: Lens' AlarmHistoryItem (Maybe Text)
+ahiAlarmName = lens _ahiAlarmName (\ s a -> s{_ahiAlarmName = a});
+
+-- | The type of alarm history item.
+ahiHistoryItemType :: Lens' AlarmHistoryItem (Maybe HistoryItemType)
+ahiHistoryItemType = lens _ahiHistoryItemType (\ s a -> s{_ahiHistoryItemType = a});
+
+-- | Machine-readable data about the alarm in JSON format.
+ahiHistoryData :: Lens' AlarmHistoryItem (Maybe Text)
+ahiHistoryData = lens _ahiHistoryData (\ s a -> s{_ahiHistoryData = a});
+
+-- | The time stamp for the alarm history item. Amazon CloudWatch uses
+-- Coordinated Universal Time (UTC) when returning time stamps, which do
+-- not accommodate seasonal adjustments such as daylight savings time. For
+-- more information, see
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps>
+-- in the /Amazon CloudWatch Developer Guide/.
+ahiTimestamp :: Lens' AlarmHistoryItem (Maybe UTCTime)
+ahiTimestamp = lens _ahiTimestamp (\ s a -> s{_ahiTimestamp = a}) . mapping _Time;
+
+-- | A human-readable summary of the alarm history.
+ahiHistorySummary :: Lens' AlarmHistoryItem (Maybe Text)
+ahiHistorySummary = lens _ahiHistorySummary (\ s a -> s{_ahiHistorySummary = a});
+
+instance FromXML AlarmHistoryItem where
+ parseXML x
+ = AlarmHistoryItem' <$>
+ (x .@? "AlarmName") <*> (x .@? "HistoryItemType") <*>
+ (x .@? "HistoryData")
+ <*> (x .@? "Timestamp")
+ <*> (x .@? "HistorySummary")
+
+-- | The 'Datapoint' data type encapsulates the statistical data that Amazon
+-- CloudWatch computes from metric data.
+--
+-- /See:/ 'datapoint' smart constructor.
+data Datapoint = Datapoint'
+ { _dSampleCount :: !(Maybe Double)
+ , _dMaximum :: !(Maybe Double)
+ , _dAverage :: !(Maybe Double)
+ , _dMinimum :: !(Maybe Double)
+ , _dSum :: !(Maybe Double)
+ , _dTimestamp :: !(Maybe ISO8601)
+ , _dUnit :: !(Maybe StandardUnit)
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'Datapoint' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'dSampleCount'
+--
+-- * 'dMaximum'
+--
+-- * 'dAverage'
+--
+-- * 'dMinimum'
+--
+-- * 'dSum'
+--
+-- * 'dTimestamp'
+--
+-- * 'dUnit'
+datapoint
+ :: Datapoint
+datapoint =
+ Datapoint'
+ { _dSampleCount = Nothing
+ , _dMaximum = Nothing
+ , _dAverage = Nothing
+ , _dMinimum = Nothing
+ , _dSum = Nothing
+ , _dTimestamp = Nothing
+ , _dUnit = Nothing
+ }
+
+-- | The number of metric values that contributed to the aggregate value of
+-- this datapoint.
+dSampleCount :: Lens' Datapoint (Maybe Double)
+dSampleCount = lens _dSampleCount (\ s a -> s{_dSampleCount = a});
+
+-- | The maximum of the metric value used for the datapoint.
+dMaximum :: Lens' Datapoint (Maybe Double)
+dMaximum = lens _dMaximum (\ s a -> s{_dMaximum = a});
+
+-- | The average of metric values that correspond to the datapoint.
+dAverage :: Lens' Datapoint (Maybe Double)
+dAverage = lens _dAverage (\ s a -> s{_dAverage = a});
+
+-- | The minimum metric value used for the datapoint.
+dMinimum :: Lens' Datapoint (Maybe Double)
+dMinimum = lens _dMinimum (\ s a -> s{_dMinimum = a});
+
+-- | The sum of metric values used for the datapoint.
+dSum :: Lens' Datapoint (Maybe Double)
+dSum = lens _dSum (\ s a -> s{_dSum = a});
+
+-- | The time stamp used for the datapoint. Amazon CloudWatch uses
+-- Coordinated Universal Time (UTC) when returning time stamps, which do
+-- not accommodate seasonal adjustments such as daylight savings time. For
+-- more information, see
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps>
+-- in the /Amazon CloudWatch Developer Guide/.
+dTimestamp :: Lens' Datapoint (Maybe UTCTime)
+dTimestamp = lens _dTimestamp (\ s a -> s{_dTimestamp = a}) . mapping _Time;
+
+-- | The standard unit used for the datapoint.
+dUnit :: Lens' Datapoint (Maybe StandardUnit)
+dUnit = lens _dUnit (\ s a -> s{_dUnit = a});
+
+instance FromXML Datapoint where
+ parseXML x
+ = Datapoint' <$>
+ (x .@? "SampleCount") <*> (x .@? "Maximum") <*>
+ (x .@? "Average")
+ <*> (x .@? "Minimum")
+ <*> (x .@? "Sum")
+ <*> (x .@? "Timestamp")
+ <*> (x .@? "Unit")
+
+-- | The 'Dimension' data type further expands on the identity of a metric
+-- using a Name, Value pair.
+--
+-- For examples that use one or more dimensions, see PutMetricData.
+--
+-- /See:/ 'dimension' smart constructor.
+data Dimension = Dimension'
+ { _dName :: !Text
+ , _dValue :: !Text
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'Dimension' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'dName'
+--
+-- * 'dValue'
+dimension
+ :: Text -- ^ 'dName'
+ -> Text -- ^ 'dValue'
+ -> Dimension
+dimension pName_ pValue_ =
+ Dimension'
+ { _dName = pName_
+ , _dValue = pValue_
+ }
+
+-- | The name of the dimension.
+dName :: Lens' Dimension Text
+dName = lens _dName (\ s a -> s{_dName = a});
+
+-- | The value representing the dimension measurement
+dValue :: Lens' Dimension Text
+dValue = lens _dValue (\ s a -> s{_dValue = a});
+
+instance FromXML Dimension where
+ parseXML x
+ = Dimension' <$> (x .@ "Name") <*> (x .@ "Value")
+
+instance ToQuery Dimension where
+ toQuery Dimension'{..}
+ = mconcat ["Name" =: _dName, "Value" =: _dValue]
+
+-- | The 'DimensionFilter' data type is used to filter ListMetrics results.
+--
+-- /See:/ 'dimensionFilter' smart constructor.
+data DimensionFilter = DimensionFilter'
+ { _dfValue :: !(Maybe Text)
+ , _dfName :: !Text
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'DimensionFilter' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'dfValue'
+--
+-- * 'dfName'
+dimensionFilter
+ :: Text -- ^ 'dfName'
+ -> DimensionFilter
+dimensionFilter pName_ =
+ DimensionFilter'
+ { _dfValue = Nothing
+ , _dfName = pName_
+ }
+
+-- | The value of the dimension to be matched.
+dfValue :: Lens' DimensionFilter (Maybe Text)
+dfValue = lens _dfValue (\ s a -> s{_dfValue = a});
+
+-- | The dimension name to be matched.
+dfName :: Lens' DimensionFilter Text
+dfName = lens _dfName (\ s a -> s{_dfName = a});
+
+instance ToQuery DimensionFilter where
+ toQuery DimensionFilter'{..}
+ = mconcat ["Value" =: _dfValue, "Name" =: _dfName]
+
+-- | The 'Metric' data type contains information about a specific metric. If
+-- you call ListMetrics, Amazon CloudWatch returns information contained by
+-- this data type.
+--
+-- The example in the Examples section publishes two metrics named buffers
+-- and latency. Both metrics are in the examples namespace. Both metrics
+-- have two dimensions, InstanceID and InstanceType.
+--
+-- /See:/ 'metric' smart constructor.
+data Metric = Metric'
+ { _mMetricName :: !(Maybe Text)
+ , _mNamespace :: !(Maybe Text)
+ , _mDimensions :: !(Maybe [Dimension])
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'Metric' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'mMetricName'
+--
+-- * 'mNamespace'
+--
+-- * 'mDimensions'
+metric
+ :: Metric
+metric =
+ Metric'
+ { _mMetricName = Nothing
+ , _mNamespace = Nothing
+ , _mDimensions = Nothing
+ }
+
+-- | The name of the metric.
+mMetricName :: Lens' Metric (Maybe Text)
+mMetricName = lens _mMetricName (\ s a -> s{_mMetricName = a});
+
+-- | The namespace of the metric.
+mNamespace :: Lens' Metric (Maybe Text)
+mNamespace = lens _mNamespace (\ s a -> s{_mNamespace = a});
+
+-- | A list of dimensions associated with the metric.
+mDimensions :: Lens' Metric [Dimension]
+mDimensions = lens _mDimensions (\ s a -> s{_mDimensions = a}) . _Default . _Coerce;
+
+instance FromXML Metric where
+ parseXML x
+ = Metric' <$>
+ (x .@? "MetricName") <*> (x .@? "Namespace") <*>
+ (x .@? "Dimensions" .!@ mempty >>=
+ may (parseXMLList "member"))
+
+-- | The MetricAlarm data type represents an alarm. You can use
+-- PutMetricAlarm to create or update an alarm.
+--
+-- /See:/ 'metricAlarm' smart constructor.
+data MetricAlarm = MetricAlarm'
+ { _maAlarmName :: !(Maybe Text)
+ , _maStateUpdatedTimestamp :: !(Maybe ISO8601)
+ , _maAlarmDescription :: !(Maybe Text)
+ , _maPeriod :: !(Maybe Nat)
+ , _maEvaluationPeriods :: !(Maybe Nat)
+ , _maMetricName :: !(Maybe Text)
+ , _maNamespace :: !(Maybe Text)
+ , _maOKActions :: !(Maybe [Text])
+ , _maComparisonOperator :: !(Maybe ComparisonOperator)
+ , _maStateValue :: !(Maybe StateValue)
+ , _maThreshold :: !(Maybe Double)
+ , _maActionsEnabled :: !(Maybe Bool)
+ , _maAlarmConfigurationUpdatedTimestamp :: !(Maybe ISO8601)
+ , _maInsufficientDataActions :: !(Maybe [Text])
+ , _maDimensions :: !(Maybe [Dimension])
+ , _maStateReasonData :: !(Maybe Text)
+ , _maStateReason :: !(Maybe Text)
+ , _maAlarmARN :: !(Maybe Text)
+ , _maAlarmActions :: !(Maybe [Text])
+ , _maStatistic :: !(Maybe Statistic)
+ , _maUnit :: !(Maybe StandardUnit)
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'MetricAlarm' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'maAlarmName'
+--
+-- * 'maStateUpdatedTimestamp'
+--
+-- * 'maAlarmDescription'
+--
+-- * 'maPeriod'
+--
+-- * 'maEvaluationPeriods'
+--
+-- * 'maMetricName'
+--
+-- * 'maNamespace'
+--
+-- * 'maOKActions'
+--
+-- * 'maComparisonOperator'
+--
+-- * 'maStateValue'
+--
+-- * 'maThreshold'
+--
+-- * 'maActionsEnabled'
+--
+-- * 'maAlarmConfigurationUpdatedTimestamp'
+--
+-- * 'maInsufficientDataActions'
+--
+-- * 'maDimensions'
+--
+-- * 'maStateReasonData'
+--
+-- * 'maStateReason'
+--
+-- * 'maAlarmARN'
+--
+-- * 'maAlarmActions'
+--
+-- * 'maStatistic'
+--
+-- * 'maUnit'
+metricAlarm
+ :: MetricAlarm
+metricAlarm =
+ MetricAlarm'
+ { _maAlarmName = Nothing
+ , _maStateUpdatedTimestamp = Nothing
+ , _maAlarmDescription = Nothing
+ , _maPeriod = Nothing
+ , _maEvaluationPeriods = Nothing
+ , _maMetricName = Nothing
+ , _maNamespace = Nothing
+ , _maOKActions = Nothing
+ , _maComparisonOperator = Nothing
+ , _maStateValue = Nothing
+ , _maThreshold = Nothing
+ , _maActionsEnabled = Nothing
+ , _maAlarmConfigurationUpdatedTimestamp = Nothing
+ , _maInsufficientDataActions = Nothing
+ , _maDimensions = Nothing
+ , _maStateReasonData = Nothing
+ , _maStateReason = Nothing
+ , _maAlarmARN = Nothing
+ , _maAlarmActions = Nothing
+ , _maStatistic = Nothing
+ , _maUnit = Nothing
+ }
+
+-- | The name of the alarm.
+maAlarmName :: Lens' MetricAlarm (Maybe Text)
+maAlarmName = lens _maAlarmName (\ s a -> s{_maAlarmName = a});
+
+-- | The time stamp of the last update to the alarm\'s state. Amazon
+-- CloudWatch uses Coordinated Universal Time (UTC) when returning time
+-- stamps, which do not accommodate seasonal adjustments such as daylight
+-- savings time. For more information, see
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps>
+-- in the /Amazon CloudWatch Developer Guide/.
+maStateUpdatedTimestamp :: Lens' MetricAlarm (Maybe UTCTime)
+maStateUpdatedTimestamp = lens _maStateUpdatedTimestamp (\ s a -> s{_maStateUpdatedTimestamp = a}) . mapping _Time;
+
+-- | The description for the alarm.
+maAlarmDescription :: Lens' MetricAlarm (Maybe Text)
+maAlarmDescription = lens _maAlarmDescription (\ s a -> s{_maAlarmDescription = a});
+
+-- | The period in seconds over which the statistic is applied.
+maPeriod :: Lens' MetricAlarm (Maybe Natural)
+maPeriod = lens _maPeriod (\ s a -> s{_maPeriod = a}) . mapping _Nat;
+
+-- | The number of periods over which data is compared to the specified
+-- threshold.
+maEvaluationPeriods :: Lens' MetricAlarm (Maybe Natural)
+maEvaluationPeriods = lens _maEvaluationPeriods (\ s a -> s{_maEvaluationPeriods = a}) . mapping _Nat;
+
+-- | The name of the alarm\'s metric.
+maMetricName :: Lens' MetricAlarm (Maybe Text)
+maMetricName = lens _maMetricName (\ s a -> s{_maMetricName = a});
+
+-- | The namespace of alarm\'s associated metric.
+maNamespace :: Lens' MetricAlarm (Maybe Text)
+maNamespace = lens _maNamespace (\ s a -> s{_maNamespace = a});
+
+-- | The list of actions to execute when this alarm transitions into an 'OK'
+-- state from any other state. Each action is specified as an Amazon
+-- Resource Number (ARN). Currently the only actions supported are
+-- publishing to an Amazon SNS topic and triggering an Auto Scaling policy.
+maOKActions :: Lens' MetricAlarm [Text]
+maOKActions = lens _maOKActions (\ s a -> s{_maOKActions = a}) . _Default . _Coerce;
+
+-- | The arithmetic operation to use when comparing the specified 'Statistic'
+-- and 'Threshold'. The specified 'Statistic' value is used as the first
+-- operand.
+maComparisonOperator :: Lens' MetricAlarm (Maybe ComparisonOperator)
+maComparisonOperator = lens _maComparisonOperator (\ s a -> s{_maComparisonOperator = a});
+
+-- | The state value for the alarm.
+maStateValue :: Lens' MetricAlarm (Maybe StateValue)
+maStateValue = lens _maStateValue (\ s a -> s{_maStateValue = a});
+
+-- | The value against which the specified statistic is compared.
+maThreshold :: Lens' MetricAlarm (Maybe Double)
+maThreshold = lens _maThreshold (\ s a -> s{_maThreshold = a});
+
+-- | Indicates whether actions should be executed during any changes to the
+-- alarm\'s state.
+maActionsEnabled :: Lens' MetricAlarm (Maybe Bool)
+maActionsEnabled = lens _maActionsEnabled (\ s a -> s{_maActionsEnabled = a});
+
+-- | The time stamp of the last update to the alarm configuration. Amazon
+-- CloudWatch uses Coordinated Universal Time (UTC) when returning time
+-- stamps, which do not accommodate seasonal adjustments such as daylight
+-- savings time. For more information, see
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps>
+-- in the /Amazon CloudWatch Developer Guide/.
+maAlarmConfigurationUpdatedTimestamp :: Lens' MetricAlarm (Maybe UTCTime)
+maAlarmConfigurationUpdatedTimestamp = lens _maAlarmConfigurationUpdatedTimestamp (\ s a -> s{_maAlarmConfigurationUpdatedTimestamp = a}) . mapping _Time;
+
+-- | The list of actions to execute when this alarm transitions into an
+-- 'INSUFFICIENT_DATA' state from any other state. Each action is specified
+-- as an Amazon Resource Number (ARN). Currently the only actions supported
+-- are publishing to an Amazon SNS topic or triggering an Auto Scaling
+-- policy.
+--
+-- The current WSDL lists this attribute as 'UnknownActions'.
+maInsufficientDataActions :: Lens' MetricAlarm [Text]
+maInsufficientDataActions = lens _maInsufficientDataActions (\ s a -> s{_maInsufficientDataActions = a}) . _Default . _Coerce;
+
+-- | The list of dimensions associated with the alarm\'s associated metric.
+maDimensions :: Lens' MetricAlarm [Dimension]
+maDimensions = lens _maDimensions (\ s a -> s{_maDimensions = a}) . _Default . _Coerce;
+
+-- | An explanation for the alarm\'s state in machine-readable JSON format
+maStateReasonData :: Lens' MetricAlarm (Maybe Text)
+maStateReasonData = lens _maStateReasonData (\ s a -> s{_maStateReasonData = a});
+
+-- | A human-readable explanation for the alarm\'s state.
+maStateReason :: Lens' MetricAlarm (Maybe Text)
+maStateReason = lens _maStateReason (\ s a -> s{_maStateReason = a});
+
+-- | The Amazon Resource Name (ARN) of the alarm.
+maAlarmARN :: Lens' MetricAlarm (Maybe Text)
+maAlarmARN = lens _maAlarmARN (\ s a -> s{_maAlarmARN = a});
+
+-- | The list of actions to execute when this alarm transitions into an
+-- 'ALARM' state from any other state. Each action is specified as an
+-- Amazon Resource Number (ARN). Currently the only actions supported are
+-- publishing to an Amazon SNS topic and triggering an Auto Scaling policy.
+maAlarmActions :: Lens' MetricAlarm [Text]
+maAlarmActions = lens _maAlarmActions (\ s a -> s{_maAlarmActions = a}) . _Default . _Coerce;
+
+-- | The statistic to apply to the alarm\'s associated metric.
+maStatistic :: Lens' MetricAlarm (Maybe Statistic)
+maStatistic = lens _maStatistic (\ s a -> s{_maStatistic = a});
+
+-- | The unit of the alarm\'s associated metric.
+maUnit :: Lens' MetricAlarm (Maybe StandardUnit)
+maUnit = lens _maUnit (\ s a -> s{_maUnit = a});
+
+instance FromXML MetricAlarm where
+ parseXML x
+ = MetricAlarm' <$>
+ (x .@? "AlarmName") <*>
+ (x .@? "StateUpdatedTimestamp")
+ <*> (x .@? "AlarmDescription")
+ <*> (x .@? "Period")
+ <*> (x .@? "EvaluationPeriods")
+ <*> (x .@? "MetricName")
+ <*> (x .@? "Namespace")
+ <*>
+ (x .@? "OKActions" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "ComparisonOperator")
+ <*> (x .@? "StateValue")
+ <*> (x .@? "Threshold")
+ <*> (x .@? "ActionsEnabled")
+ <*> (x .@? "AlarmConfigurationUpdatedTimestamp")
+ <*>
+ (x .@? "InsufficientDataActions" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*>
+ (x .@? "Dimensions" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "StateReasonData")
+ <*> (x .@? "StateReason")
+ <*> (x .@? "AlarmArn")
+ <*>
+ (x .@? "AlarmActions" .!@ mempty >>=
+ may (parseXMLList "member"))
+ <*> (x .@? "Statistic")
+ <*> (x .@? "Unit")
+
+-- | The 'MetricDatum' data type encapsulates the information sent with
+-- PutMetricData to either create a new metric or add new values to be
+-- aggregated into an existing metric.
+--
+-- /See:/ 'metricDatum' smart constructor.
+data MetricDatum = MetricDatum'
+ { _mdValue :: !(Maybe Double)
+ , _mdDimensions :: !(Maybe [Dimension])
+ , _mdTimestamp :: !(Maybe ISO8601)
+ , _mdStatisticValues :: !(Maybe StatisticSet)
+ , _mdUnit :: !(Maybe StandardUnit)
+ , _mdMetricName :: !Text
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'MetricDatum' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'mdValue'
+--
+-- * 'mdDimensions'
+--
+-- * 'mdTimestamp'
+--
+-- * 'mdStatisticValues'
+--
+-- * 'mdUnit'
+--
+-- * 'mdMetricName'
+metricDatum
+ :: Text -- ^ 'mdMetricName'
+ -> MetricDatum
+metricDatum pMetricName_ =
+ MetricDatum'
+ { _mdValue = Nothing
+ , _mdDimensions = Nothing
+ , _mdTimestamp = Nothing
+ , _mdStatisticValues = Nothing
+ , _mdUnit = Nothing
+ , _mdMetricName = pMetricName_
+ }
+
+-- | The value for the metric.
+--
+-- Although the 'Value' parameter accepts numbers of type 'Double', Amazon
+-- CloudWatch truncates values with very large exponents. Values with
+-- base-10 exponents greater than 126 (1 x 10^126) are truncated. Likewise,
+-- values with base-10 exponents less than -130 (1 x 10^-130) are also
+-- truncated.
+mdValue :: Lens' MetricDatum (Maybe Double)
+mdValue = lens _mdValue (\ s a -> s{_mdValue = a});
+
+-- | A list of dimensions associated with the metric. Note, when using the
+-- Dimensions value in a query, you need to append .member.N to it (e.g.,
+-- Dimensions.member.N).
+mdDimensions :: Lens' MetricDatum [Dimension]
+mdDimensions = lens _mdDimensions (\ s a -> s{_mdDimensions = a}) . _Default . _Coerce;
+
+-- | The time stamp used for the metric. If not specified, the default value
+-- is set to the time the metric data was received. Amazon CloudWatch uses
+-- Coordinated Universal Time (UTC) when returning time stamps, which do
+-- not accommodate seasonal adjustments such as daylight savings time. For
+-- more information, see
+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp Time stamps>
+-- in the /Amazon CloudWatch Developer Guide/.
+mdTimestamp :: Lens' MetricDatum (Maybe UTCTime)
+mdTimestamp = lens _mdTimestamp (\ s a -> s{_mdTimestamp = a}) . mapping _Time;
+
+-- | A set of statistical values describing the metric.
+mdStatisticValues :: Lens' MetricDatum (Maybe StatisticSet)
+mdStatisticValues = lens _mdStatisticValues (\ s a -> s{_mdStatisticValues = a});
+
+-- | The unit of the metric.
+mdUnit :: Lens' MetricDatum (Maybe StandardUnit)
+mdUnit = lens _mdUnit (\ s a -> s{_mdUnit = a});
+
+-- | The name of the metric.
+mdMetricName :: Lens' MetricDatum Text
+mdMetricName = lens _mdMetricName (\ s a -> s{_mdMetricName = a});
+
+instance ToQuery MetricDatum where
+ toQuery MetricDatum'{..}
+ = mconcat
+ ["Value" =: _mdValue,
+ "Dimensions" =:
+ toQuery (toQueryList "member" <$> _mdDimensions),
+ "Timestamp" =: _mdTimestamp,
+ "StatisticValues" =: _mdStatisticValues,
+ "Unit" =: _mdUnit, "MetricName" =: _mdMetricName]
+
+-- | The 'StatisticSet' data type describes the 'StatisticValues' component
+-- of MetricDatum, and represents a set of statistics that describes a
+-- specific metric.
+--
+-- /See:/ 'statisticSet' smart constructor.
+data StatisticSet = StatisticSet'
+ { _ssSampleCount :: !Double
+ , _ssSum :: !Double
+ , _ssMinimum :: !Double
+ , _ssMaximum :: !Double
+ } deriving (Eq,Read,Show,Data,Typeable,Generic)
+
+-- | Creates a value of 'StatisticSet' with the minimum fields required to make a request.
+--
+-- Use one of the following lenses to modify other fields as desired:
+--
+-- * 'ssSampleCount'
+--
+-- * 'ssSum'
+--
+-- * 'ssMinimum'
+--
+-- * 'ssMaximum'
+statisticSet
+ :: Double -- ^ 'ssSampleCount'
+ -> Double -- ^ 'ssSum'
+ -> Double -- ^ 'ssMinimum'
+ -> Double -- ^ 'ssMaximum'
+ -> StatisticSet
+statisticSet pSampleCount_ pSum_ pMinimum_ pMaximum_ =
+ StatisticSet'
+ { _ssSampleCount = pSampleCount_
+ , _ssSum = pSum_
+ , _ssMinimum = pMinimum_
+ , _ssMaximum = pMaximum_
+ }
+
+-- | The number of samples used for the statistic set.
+ssSampleCount :: Lens' StatisticSet Double
+ssSampleCount = lens _ssSampleCount (\ s a -> s{_ssSampleCount = a});
+
+-- | The sum of values for the sample set.
+ssSum :: Lens' StatisticSet Double
+ssSum = lens _ssSum (\ s a -> s{_ssSum = a});
+
+-- | The minimum value of the sample set.
+ssMinimum :: Lens' StatisticSet Double
+ssMinimum = lens _ssMinimum (\ s a -> s{_ssMinimum = a});
+
+-- | The maximum value of the sample set.
+ssMaximum :: Lens' StatisticSet Double
+ssMaximum = lens _ssMaximum (\ s a -> s{_ssMaximum = a});
+
+instance ToQuery StatisticSet where
+ toQuery StatisticSet'{..}
+ = mconcat
+ ["SampleCount" =: _ssSampleCount, "Sum" =: _ssSum,
+ "Minimum" =: _ssMinimum, "Maximum" =: _ssMaximum]
diff --git a/gen/Network/AWS/CloudWatch/Types/Sum.hs b/gen/Network/AWS/CloudWatch/Types/Sum.hs
new file mode 100644
index 0000000..b0c738c
--- /dev/null
+++ b/gen/Network/AWS/CloudWatch/Types/Sum.hs
@@ -0,0 +1,241 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE OverloadedStrings #-}
+
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
+-- Module : Network.AWS.CloudWatch.Types.Sum
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : auto-generated
+-- Portability : non-portable (GHC extensions)
+--
+module Network.AWS.CloudWatch.Types.Sum where
+
+import Network.AWS.Prelude
+
+data ComparisonOperator
+ = GreaterThanOrEqualToThreshold
+ | GreaterThanThreshold
+ | LessThanOrEqualToThreshold
+ | LessThanThreshold
+ deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)
+
+instance FromText ComparisonOperator where
+ parser = takeLowerText >>= \case
+ "greaterthanorequaltothreshold" -> pure GreaterThanOrEqualToThreshold
+ "greaterthanthreshold" -> pure GreaterThanThreshold
+ "lessthanorequaltothreshold" -> pure LessThanOrEqualToThreshold
+ "lessthanthreshold" -> pure LessThanThreshold
+ e -> fromTextError $ "Failure parsing ComparisonOperator from value: '" <> e
+ <> "'. Accepted values: greaterthanorequaltothreshold, greaterthanthreshold, lessthanorequaltothreshold, lessthanthreshold"
+
+instance ToText ComparisonOperator where
+ toText = \case
+ GreaterThanOrEqualToThreshold -> "greaterthanorequaltothreshold"
+ GreaterThanThreshold -> "greaterthanthreshold"
+ LessThanOrEqualToThreshold -> "lessthanorequaltothreshold"
+ LessThanThreshold -> "lessthanthreshold"
+
+instance Hashable ComparisonOperator
+instance ToByteString ComparisonOperator
+instance ToQuery ComparisonOperator
+instance ToHeader ComparisonOperator
+
+instance FromXML ComparisonOperator where
+ parseXML = parseXMLText "ComparisonOperator"
+
+data HistoryItemType
+ = Action
+ | ConfigurationUpdate
+ | StateUpdate
+ deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)
+
+instance FromText HistoryItemType where
+ parser = takeLowerText >>= \case
+ "action" -> pure Action
+ "configurationupdate" -> pure ConfigurationUpdate
+ "stateupdate" -> pure StateUpdate
+ e -> fromTextError $ "Failure parsing HistoryItemType from value: '" <> e
+ <> "'. Accepted values: action, configurationupdate, stateupdate"
+
+instance ToText HistoryItemType where
+ toText = \case
+ Action -> "action"
+ ConfigurationUpdate -> "configurationupdate"
+ StateUpdate -> "stateupdate"
+
+instance Hashable HistoryItemType
+instance ToByteString HistoryItemType
+instance ToQuery HistoryItemType
+instance ToHeader HistoryItemType
+
+instance FromXML HistoryItemType where
+ parseXML = parseXMLText "HistoryItemType"
+
+data StandardUnit
+ = Bits
+ | BitsSecond
+ | Bytes
+ | BytesSecond
+ | Count
+ | CountSecond
+ | Gigabits
+ | GigabitsSecond
+ | Gigabytes
+ | GigabytesSecond
+ | Kilobits
+ | KilobitsSecond
+ | Kilobytes
+ | KilobytesSecond
+ | Megabits
+ | MegabitsSecond
+ | Megabytes
+ | MegabytesSecond
+ | Microseconds
+ | Milliseconds
+ | None
+ | Percent
+ | Seconds
+ | Terabits
+ | TerabitsSecond
+ | Terabytes
+ | TerabytesSecond
+ deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)
+
+instance FromText StandardUnit where
+ parser = takeLowerText >>= \case
+ "bits" -> pure Bits
+ "bits/second" -> pure BitsSecond
+ "bytes" -> pure Bytes
+ "bytes/second" -> pure BytesSecond
+ "count" -> pure Count
+ "count/second" -> pure CountSecond
+ "gigabits" -> pure Gigabits
+ "gigabits/second" -> pure GigabitsSecond
+ "gigabytes" -> pure Gigabytes
+ "gigabytes/second" -> pure GigabytesSecond
+ "kilobits" -> pure Kilobits
+ "kilobits/second" -> pure KilobitsSecond
+ "kilobytes" -> pure Kilobytes
+ "kilobytes/second" -> pure KilobytesSecond
+ "megabits" -> pure Megabits
+ "megabits/second" -> pure MegabitsSecond
+ "megabytes" -> pure Megabytes
+ "megabytes/second" -> pure MegabytesSecond
+ "microseconds" -> pure Microseconds
+ "milliseconds" -> pure Milliseconds
+ "none" -> pure None
+ "percent" -> pure Percent
+ "seconds" -> pure Seconds
+ "terabits" -> pure Terabits
+ "terabits/second" -> pure TerabitsSecond
+ "terabytes" -> pure Terabytes
+ "terabytes/second" -> pure TerabytesSecond
+ e -> fromTextError $ "Failure parsing StandardUnit from value: '" <> e
+ <> "'. Accepted values: bits, bits/second, bytes, bytes/second, count, count/second, gigabits, gigabits/second, gigabytes, gigabytes/second, kilobits, kilobits/second, kilobytes, kilobytes/second, megabits, megabits/second, megabytes, megabytes/second, microseconds, milliseconds, none, percent, seconds, terabits, terabits/second, terabytes, terabytes/second"
+
+instance ToText StandardUnit where
+ toText = \case
+ Bits -> "bits"
+ BitsSecond -> "bits/second"
+ Bytes -> "bytes"
+ BytesSecond -> "bytes/second"
+ Count -> "count"
+ CountSecond -> "count/second"
+ Gigabits -> "gigabits"
+ GigabitsSecond -> "gigabits/second"
+ Gigabytes -> "gigabytes"
+ GigabytesSecond -> "gigabytes/second"
+ Kilobits -> "kilobits"
+ KilobitsSecond -> "kilobits/second"
+ Kilobytes -> "kilobytes"
+ KilobytesSecond -> "kilobytes/second"
+ Megabits -> "megabits"
+ MegabitsSecond -> "megabits/second"
+ Megabytes -> "megabytes"
+ MegabytesSecond -> "megabytes/second"
+ Microseconds -> "microseconds"
+ Milliseconds -> "milliseconds"
+ None -> "none"
+ Percent -> "percent"
+ Seconds -> "seconds"
+ Terabits -> "terabits"
+ TerabitsSecond -> "terabits/second"
+ Terabytes -> "terabytes"
+ TerabytesSecond -> "terabytes/second"
+
+instance Hashable StandardUnit
+instance ToByteString StandardUnit
+instance ToQuery StandardUnit
+instance ToHeader StandardUnit
+
+instance FromXML StandardUnit where
+ parseXML = parseXMLText "StandardUnit"
+
+data StateValue
+ = Alarm
+ | InsufficientData
+ | OK
+ deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)
+
+instance FromText StateValue where
+ parser = takeLowerText >>= \case
+ "alarm" -> pure Alarm
+ "insufficient_data" -> pure InsufficientData
+ "ok" -> pure OK
+ e -> fromTextError $ "Failure parsing StateValue from value: '" <> e
+ <> "'. Accepted values: alarm, insufficient_data, ok"
+
+instance ToText StateValue where
+ toText = \case
+ Alarm -> "alarm"
+ InsufficientData -> "insufficient_data"
+ OK -> "ok"
+
+instance Hashable StateValue
+instance ToByteString StateValue
+instance ToQuery StateValue
+instance ToHeader StateValue
+
+instance FromXML StateValue where
+ parseXML = parseXMLText "StateValue"
+
+data Statistic
+ = Average
+ | Maximum
+ | Minimum
+ | SampleCount
+ | Sum
+ deriving (Eq,Ord,Read,Show,Enum,Data,Typeable,Generic)
+
+instance FromText Statistic where
+ parser = takeLowerText >>= \case
+ "average" -> pure Average
+ "maximum" -> pure Maximum
+ "minimum" -> pure Minimum
+ "samplecount" -> pure SampleCount
+ "sum" -> pure Sum
+ e -> fromTextError $ "Failure parsing Statistic from value: '" <> e
+ <> "'. Accepted values: average, maximum, minimum, samplecount, sum"
+
+instance ToText Statistic where
+ toText = \case
+ Average -> "average"
+ Maximum -> "maximum"
+ Minimum -> "minimum"
+ SampleCount -> "samplecount"
+ Sum -> "sum"
+
+instance Hashable Statistic
+instance ToByteString Statistic
+instance ToQuery Statistic
+instance ToHeader Statistic
+
+instance FromXML Statistic where
+ parseXML = parseXMLText "Statistic"
diff --git a/gen/Network/AWS/CloudWatch/Waiters.hs b/gen/Network/AWS/CloudWatch/Waiters.hs
new file mode 100644
index 0000000..b18a0db
--- /dev/null
+++ b/gen/Network/AWS/CloudWatch/Waiters.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TypeFamilies #-}
+
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
+-- Module : Network.AWS.CloudWatch.Waiters
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : auto-generated
+-- Portability : non-portable (GHC extensions)
+--
+module Network.AWS.CloudWatch.Waiters where
+
+import Network.AWS.CloudWatch.Types
+import Network.AWS.Prelude
+import Network.AWS.Waiter
diff --git a/test/Main.hs b/test/Main.hs
new file mode 100644
index 0000000..c0a0e25
--- /dev/null
+++ b/test/Main.hs
@@ -0,0 +1,21 @@
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+
+-- |
+-- Module : Main
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : auto-generated
+-- Portability : non-portable (GHC extensions)
+--
+module Main (main) where
+
+import Test.Tasty
+import Test.AWS.CloudWatch
+import Test.AWS.CloudWatch.Internal
+
+main :: IO ()
+main = defaultMain $ testGroup "CloudWatch"
+ [ testGroup "tests" tests
+ , testGroup "fixtures" fixtures
+ ]
diff --git a/test/Test/AWS/CloudWatch.hs b/test/Test/AWS/CloudWatch.hs
new file mode 100644
index 0000000..efbca70
--- /dev/null
+++ b/test/Test/AWS/CloudWatch.hs
@@ -0,0 +1,26 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+-- Module : Test.AWS.CloudWatch
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : This Source Code Form is subject to the terms of
+-- the Mozilla Public License, v. 2.0.
+-- A copy of the MPL can be found in the LICENSE file or
+-- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : experimental
+-- Portability : non-portable (GHC extensions)
+
+module Test.AWS.CloudWatch
+ ( tests
+ , fixtures
+ ) where
+
+import Network.AWS.CloudWatch
+import Test.AWS.Gen.CloudWatch
+import Test.Tasty
+
+tests :: [TestTree]
+tests = []
+
+fixtures :: [TestTree]
+fixtures = []
diff --git a/test/Test/AWS/CloudWatch/Internal.hs b/test/Test/AWS/CloudWatch/Internal.hs
new file mode 100644
index 0000000..d0de718
--- /dev/null
+++ b/test/Test/AWS/CloudWatch/Internal.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+
+-- Module : Test.AWS.CloudWatch.Internal
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : This Source Code Form is subject to the terms of
+-- the Mozilla Public License, v. 2.0.
+-- A copy of the MPL can be found in the LICENSE file or
+-- you can obtain it at http://mozilla.org/MPL/2.0/.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : experimental
+-- Portability : non-portable (GHC extensions)
+
+module Test.AWS.CloudWatch.Internal where
+
+import Test.AWS.Prelude
diff --git a/test/Test/AWS/Gen/CloudWatch.hs b/test/Test/AWS/Gen/CloudWatch.hs
new file mode 100644
index 0000000..a2576ff
--- /dev/null
+++ b/test/Test/AWS/Gen/CloudWatch.hs
@@ -0,0 +1,226 @@
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
+-- Derived from AWS service descriptions, licensed under Apache 2.0.
+
+-- |
+-- Module : Test.AWS.Gen.CloudWatch
+-- Copyright : (c) 2013-2015 Brendan Hay
+-- License : Mozilla Public License, v. 2.0.
+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
+-- Stability : auto-generated
+-- Portability : non-portable (GHC extensions)
+--
+module Test.AWS.Gen.CloudWatch where
+
+import Data.Proxy
+import Test.AWS.Fixture
+import Test.AWS.Prelude
+import Test.Tasty
+import Network.AWS.CloudWatch
+import Test.AWS.CloudWatch.Internal
+
+-- Auto-generated: the actual test selection needs to be manually placed into
+-- the top-level so that real test data can be incrementally added.
+--
+-- This commented snippet is what the entire set should look like:
+
+-- fixtures :: TestTree
+-- fixtures =
+-- [ testGroup "request"
+-- [ testEnableAlarmActions $
+-- enableAlarmActions
+--
+-- , testPutMetricData $
+-- putMetricData
+--
+-- , testDescribeAlarms $
+-- describeAlarms
+--
+-- , testListMetrics $
+-- listMetrics
+--
+-- , testDeleteAlarms $
+-- deleteAlarms
+--
+-- , testDescribeAlarmHistory $
+-- describeAlarmHistory
+--
+-- , testGetMetricStatistics $
+-- getMetricStatistics
+--
+-- , testDisableAlarmActions $
+-- disableAlarmActions
+--
+-- , testDescribeAlarmsForMetric $
+-- describeAlarmsForMetric
+--
+-- , testSetAlarmState $
+-- setAlarmState
+--
+-- , testPutMetricAlarm $
+-- putMetricAlarm
+--
+-- ]
+
+-- , testGroup "response"
+-- [ testEnableAlarmActionsResponse $
+-- enableAlarmActionsResponse
+--
+-- , testPutMetricDataResponse $
+-- putMetricDataResponse
+--
+-- , testDescribeAlarmsResponse $
+-- describeAlarmsResponse
+--
+-- , testListMetricsResponse $
+-- listMetricsResponse
+--
+-- , testDeleteAlarmsResponse $
+-- deleteAlarmsResponse
+--
+-- , testDescribeAlarmHistoryResponse $
+-- describeAlarmHistoryResponse
+--
+-- , testGetMetricStatisticsResponse $
+-- getMetricStatisticsResponse
+--
+-- , testDisableAlarmActionsResponse $
+-- disableAlarmActionsResponse
+--
+-- , testDescribeAlarmsForMetricResponse $
+-- describeAlarmsForMetricResponse
+--
+-- , testSetAlarmStateResponse $
+-- setAlarmStateResponse
+--
+-- , testPutMetricAlarmResponse $
+-- putMetricAlarmResponse
+--
+-- ]
+-- ]
+
+-- Requests
+
+testEnableAlarmActions :: EnableAlarmActions -> TestTree
+testEnableAlarmActions = req
+ "EnableAlarmActions"
+ "fixture/EnableAlarmActions"
+
+testPutMetricData :: PutMetricData -> TestTree
+testPutMetricData = req
+ "PutMetricData"
+ "fixture/PutMetricData"
+
+testDescribeAlarms :: DescribeAlarms -> TestTree
+testDescribeAlarms = req
+ "DescribeAlarms"
+ "fixture/DescribeAlarms"
+
+testListMetrics :: ListMetrics -> TestTree
+testListMetrics = req
+ "ListMetrics"
+ "fixture/ListMetrics"
+
+testDeleteAlarms :: DeleteAlarms -> TestTree
+testDeleteAlarms = req
+ "DeleteAlarms"
+ "fixture/DeleteAlarms"
+
+testDescribeAlarmHistory :: DescribeAlarmHistory -> TestTree
+testDescribeAlarmHistory = req
+ "DescribeAlarmHistory"
+ "fixture/DescribeAlarmHistory"
+
+testGetMetricStatistics :: GetMetricStatistics -> TestTree
+testGetMetricStatistics = req
+ "GetMetricStatistics"
+ "fixture/GetMetricStatistics"
+
+testDisableAlarmActions :: DisableAlarmActions -> TestTree
+testDisableAlarmActions = req
+ "DisableAlarmActions"
+ "fixture/DisableAlarmActions"
+
+testDescribeAlarmsForMetric :: DescribeAlarmsForMetric -> TestTree
+testDescribeAlarmsForMetric = req
+ "DescribeAlarmsForMetric"
+ "fixture/DescribeAlarmsForMetric"
+
+testSetAlarmState :: SetAlarmState -> TestTree
+testSetAlarmState = req
+ "SetAlarmState"
+ "fixture/SetAlarmState"
+
+testPutMetricAlarm :: PutMetricAlarm -> TestTree
+testPutMetricAlarm = req
+ "PutMetricAlarm"
+ "fixture/PutMetricAlarm"
+
+-- Responses
+
+testEnableAlarmActionsResponse :: EnableAlarmActionsResponse -> TestTree
+testEnableAlarmActionsResponse = res
+ "EnableAlarmActionsResponse"
+ "fixture/EnableAlarmActionsResponse"
+ (Proxy :: Proxy EnableAlarmActions)
+
+testPutMetricDataResponse :: PutMetricDataResponse -> TestTree
+testPutMetricDataResponse = res
+ "PutMetricDataResponse"
+ "fixture/PutMetricDataResponse"
+ (Proxy :: Proxy PutMetricData)
+
+testDescribeAlarmsResponse :: DescribeAlarmsResponse -> TestTree
+testDescribeAlarmsResponse = res
+ "DescribeAlarmsResponse"
+ "fixture/DescribeAlarmsResponse"
+ (Proxy :: Proxy DescribeAlarms)
+
+testListMetricsResponse :: ListMetricsResponse -> TestTree
+testListMetricsResponse = res
+ "ListMetricsResponse"
+ "fixture/ListMetricsResponse"
+ (Proxy :: Proxy ListMetrics)
+
+testDeleteAlarmsResponse :: DeleteAlarmsResponse -> TestTree
+testDeleteAlarmsResponse = res
+ "DeleteAlarmsResponse"
+ "fixture/DeleteAlarmsResponse"
+ (Proxy :: Proxy DeleteAlarms)
+
+testDescribeAlarmHistoryResponse :: DescribeAlarmHistoryResponse -> TestTree
+testDescribeAlarmHistoryResponse = res
+ "DescribeAlarmHistoryResponse"
+ "fixture/DescribeAlarmHistoryResponse"
+ (Proxy :: Proxy DescribeAlarmHistory)
+
+testGetMetricStatisticsResponse :: GetMetricStatisticsResponse -> TestTree
+testGetMetricStatisticsResponse = res
+ "GetMetricStatisticsResponse"
+ "fixture/GetMetricStatisticsResponse"
+ (Proxy :: Proxy GetMetricStatistics)
+
+testDisableAlarmActionsResponse :: DisableAlarmActionsResponse -> TestTree
+testDisableAlarmActionsResponse = res
+ "DisableAlarmActionsResponse"
+ "fixture/DisableAlarmActionsResponse"
+ (Proxy :: Proxy DisableAlarmActions)
+
+testDescribeAlarmsForMetricResponse :: DescribeAlarmsForMetricResponse -> TestTree
+testDescribeAlarmsForMetricResponse = res
+ "DescribeAlarmsForMetricResponse"
+ "fixture/DescribeAlarmsForMetricResponse"
+ (Proxy :: Proxy DescribeAlarmsForMetric)
+
+testSetAlarmStateResponse :: SetAlarmStateResponse -> TestTree
+testSetAlarmStateResponse = res
+ "SetAlarmStateResponse"
+ "fixture/SetAlarmStateResponse"
+ (Proxy :: Proxy SetAlarmState)
+
+testPutMetricAlarmResponse :: PutMetricAlarmResponse -> TestTree
+testPutMetricAlarmResponse = res
+ "PutMetricAlarmResponse"
+ "fixture/PutMetricAlarmResponse"
+ (Proxy :: Proxy PutMetricAlarm)