packages feed

amazonka-cloudwatch (empty) → 0.0.0

raw patch · 17 files changed

+3249/−0 lines, 17 filesdep +amazonka-coredep +basesetup-changed

Dependencies added: amazonka-core, base

Files

+ LICENSE view
@@ -0,0 +1,373 @@+Mozilla Public License Version 2.0+==================================++1. Definitions+--------------++1.1. "Contributor"+    means each individual or legal entity that creates, contributes to+    the creation of, or owns Covered Software.++1.2. "Contributor Version"+    means the combination of the Contributions of others (if any) used+    by a Contributor and that particular Contributor's Contribution.++1.3. "Contribution"+    means Covered Software of a particular Contributor.++1.4. "Covered Software"+    means Source Code Form to which the initial Contributor has attached+    the notice in Exhibit A, the Executable Form of such Source Code+    Form, and Modifications of such Source Code Form, in each case+    including portions thereof.++1.5. "Incompatible With Secondary Licenses"+    means++    (a) that the initial Contributor has attached the notice described+        in Exhibit B to the Covered Software; or++    (b) that the Covered Software was made available under the terms of+        version 1.1 or earlier of the License, but not also under the+        terms of a Secondary License.++1.6. "Executable Form"+    means any form of the work other than Source Code Form.++1.7. "Larger Work"+    means a work that combines Covered Software with other material, in+    a separate file or files, that is not Covered Software.++1.8. "License"+    means this document.++1.9. "Licensable"+    means having the right to grant, to the maximum extent possible,+    whether at the time of the initial grant or subsequently, any and+    all of the rights conveyed by this License.++1.10. "Modifications"+    means any of the following:++    (a) any file in Source Code Form that results from an addition to,+        deletion from, or modification of the contents of Covered+        Software; or++    (b) any new file in Source Code Form that contains any Covered+        Software.++1.11. "Patent Claims" of a Contributor+    means any patent claim(s), including without limitation, method,+    process, and apparatus claims, in any patent Licensable by such+    Contributor that would be infringed, but for the grant of the+    License, by the making, using, selling, offering for sale, having+    made, import, or transfer of either its Contributions or its+    Contributor Version.++1.12. "Secondary License"+    means either the GNU General Public License, Version 2.0, the GNU+    Lesser General Public License, Version 2.1, the GNU Affero General+    Public License, Version 3.0, or any later versions of those+    licenses.++1.13. "Source Code Form"+    means the form of the work preferred for making modifications.++1.14. "You" (or "Your")+    means an individual or a legal entity exercising rights under this+    License. For legal entities, "You" includes any entity that+    controls, is controlled by, or is under common control with You. For+    purposes of this definition, "control" means (a) the power, direct+    or indirect, to cause the direction or management of such entity,+    whether by contract or otherwise, or (b) ownership of more than+    fifty percent (50%) of the outstanding shares or beneficial+    ownership of such entity.++2. License Grants and Conditions+--------------------------------++2.1. Grants++Each Contributor hereby grants You a world-wide, royalty-free,+non-exclusive license:++(a) under intellectual property rights (other than patent or trademark)+    Licensable by such Contributor to use, reproduce, make available,+    modify, display, perform, distribute, and otherwise exploit its+    Contributions, either on an unmodified basis, with Modifications, or+    as part of a Larger Work; and++(b) under Patent Claims of such Contributor to make, use, sell, offer+    for sale, have made, import, and otherwise transfer either its+    Contributions or its Contributor Version.++2.2. Effective Date++The licenses granted in Section 2.1 with respect to any Contribution+become effective for each Contribution on the date the Contributor first+distributes such Contribution.++2.3. Limitations on Grant Scope++The licenses granted in this Section 2 are the only rights granted under+this License. No additional rights or licenses will be implied from the+distribution or licensing of Covered Software under this License.+Notwithstanding Section 2.1(b) above, no patent license is granted by a+Contributor:++(a) for any code that a Contributor has removed from Covered Software;+    or++(b) for infringements caused by: (i) Your and any other third party's+    modifications of Covered Software, or (ii) the combination of its+    Contributions with other software (except as part of its Contributor+    Version); or++(c) under Patent Claims infringed by Covered Software in the absence of+    its Contributions.++This License does not grant any rights in the trademarks, service marks,+or logos of any Contributor (except as may be necessary to comply with+the notice requirements in Section 3.4).++2.4. Subsequent Licenses++No Contributor makes additional grants as a result of Your choice to+distribute the Covered Software under a subsequent version of this+License (see Section 10.2) or under the terms of a Secondary License (if+permitted under the terms of Section 3.3).++2.5. Representation++Each Contributor represents that the Contributor believes its+Contributions are its original creation(s) or it has sufficient rights+to grant the rights to its Contributions conveyed by this License.++2.6. Fair Use++This License is not intended to limit any rights You have under+applicable copyright doctrines of fair use, fair dealing, or other+equivalents.++2.7. Conditions++Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted+in Section 2.1.++3. Responsibilities+-------------------++3.1. Distribution of Source Form++All distribution of Covered Software in Source Code Form, including any+Modifications that You create or to which You contribute, must be under+the terms of this License. You must inform recipients that the Source+Code Form of the Covered Software is governed by the terms of this+License, and how they can obtain a copy of this License. You may not+attempt to alter or restrict the recipients' rights in the Source Code+Form.++3.2. Distribution of Executable Form++If You distribute Covered Software in Executable Form then:++(a) such Covered Software must also be made available in Source Code+    Form, as described in Section 3.1, and You must inform recipients of+    the Executable Form how they can obtain a copy of such Source Code+    Form by reasonable means in a timely manner, at a charge no more+    than the cost of distribution to the recipient; and++(b) You may distribute such Executable Form under the terms of this+    License, or sublicense it under different terms, provided that the+    license for the Executable Form does not attempt to limit or alter+    the recipients' rights in the Source Code Form under this License.++3.3. Distribution of a Larger Work++You may create and distribute a Larger Work under terms of Your choice,+provided that You also comply with the requirements of this License for+the Covered Software. If the Larger Work is a combination of Covered+Software with a work governed by one or more Secondary Licenses, and the+Covered Software is not Incompatible With Secondary Licenses, this+License permits You to additionally distribute such Covered Software+under the terms of such Secondary License(s), so that the recipient of+the Larger Work may, at their option, further distribute the Covered+Software under the terms of either this License or such Secondary+License(s).++3.4. Notices++You may not remove or alter the substance of any license notices+(including copyright notices, patent notices, disclaimers of warranty,+or limitations of liability) contained within the Source Code Form of+the Covered Software, except that You may alter any license notices to+the extent required to remedy known factual inaccuracies.++3.5. Application of Additional Terms++You may choose to offer, and to charge a fee for, warranty, support,+indemnity or liability obligations to one or more recipients of Covered+Software. However, You may do so only on Your own behalf, and not on+behalf of any Contributor. You must make it absolutely clear that any+such warranty, support, indemnity, or liability obligation is offered by+You alone, and You hereby agree to indemnify every Contributor for any+liability incurred by such Contributor as a result of warranty, support,+indemnity or liability terms You offer. You may include additional+disclaimers of warranty and limitations of liability specific to any+jurisdiction.++4. Inability to Comply Due to Statute or Regulation+---------------------------------------------------++If it is impossible for You to comply with any of the terms of this+License with respect to some or all of the Covered Software due to+statute, judicial order, or regulation then You must: (a) comply with+the terms of this License to the maximum extent possible; and (b)+describe the limitations and the code they affect. Such description must+be placed in a text file included with all distributions of the Covered+Software under this License. Except to the extent prohibited by statute+or regulation, such description must be sufficiently detailed for a+recipient of ordinary skill to be able to understand it.++5. Termination+--------------++5.1. The rights granted under this License will terminate automatically+if You fail to comply with any of its terms. However, if You become+compliant, then the rights granted under this License from a particular+Contributor are reinstated (a) provisionally, unless and until such+Contributor explicitly and finally terminates Your grants, and (b) on an+ongoing basis, if such Contributor fails to notify You of the+non-compliance by some reasonable means prior to 60 days after You have+come back into compliance. Moreover, Your grants from a particular+Contributor are reinstated on an ongoing basis if such Contributor+notifies You of the non-compliance by some reasonable means, this is the+first time You have received notice of non-compliance with this License+from such Contributor, and You become compliant prior to 30 days after+Your receipt of the notice.++5.2. If You initiate litigation against any entity by asserting a patent+infringement claim (excluding declaratory judgment actions,+counter-claims, and cross-claims) alleging that a Contributor Version+directly or indirectly infringes any patent, then the rights granted to+You by any and all Contributors for the Covered Software under Section+2.1 of this License shall terminate.++5.3. In the event of termination under Sections 5.1 or 5.2 above, all+end user license agreements (excluding distributors and resellers) which+have been validly granted by You or Your distributors under this License+prior to termination shall survive termination.++************************************************************************+*                                                                      *+*  6. Disclaimer of Warranty                                           *+*  -------------------------                                           *+*                                                                      *+*  Covered Software is provided under this License on an "as is"       *+*  basis, without warranty of any kind, either expressed, implied, or  *+*  statutory, including, without limitation, warranties that the       *+*  Covered Software is free of defects, merchantable, fit for a        *+*  particular purpose or non-infringing. The entire risk as to the     *+*  quality and performance of the Covered Software is with You.        *+*  Should any Covered Software prove defective in any respect, You     *+*  (not any Contributor) assume the cost of any necessary servicing,   *+*  repair, or correction. This disclaimer of warranty constitutes an   *+*  essential part of this License. No use of any Covered Software is   *+*  authorized under this License except under this disclaimer.         *+*                                                                      *+************************************************************************++************************************************************************+*                                                                      *+*  7. Limitation of Liability                                          *+*  --------------------------                                          *+*                                                                      *+*  Under no circumstances and under no legal theory, whether tort      *+*  (including negligence), contract, or otherwise, shall any           *+*  Contributor, or anyone who distributes Covered Software as          *+*  permitted above, be liable to You for any direct, indirect,         *+*  special, incidental, or consequential damages of any character      *+*  including, without limitation, damages for lost profits, loss of    *+*  goodwill, work stoppage, computer failure or malfunction, or any    *+*  and all other commercial damages or losses, even if such party      *+*  shall have been informed of the possibility of such damages. This   *+*  limitation of liability shall not apply to liability for death or   *+*  personal injury resulting from such party's negligence to the       *+*  extent applicable law prohibits such limitation. Some               *+*  jurisdictions do not allow the exclusion or limitation of           *+*  incidental or consequential damages, so this exclusion and          *+*  limitation may not apply to You.                                    *+*                                                                      *+************************************************************************++8. Litigation+-------------++Any litigation relating to this License may be brought only in the+courts of a jurisdiction where the defendant maintains its principal+place of business and such litigation shall be governed by laws of that+jurisdiction, without reference to its conflict-of-law provisions.+Nothing in this Section shall prevent a party's ability to bring+cross-claims or counter-claims.++9. Miscellaneous+----------------++This License represents the complete agreement concerning the subject+matter hereof. If any provision of this License is held to be+unenforceable, such provision shall be reformed only to the extent+necessary to make it enforceable. Any law or regulation which provides+that the language of a contract shall be construed against the drafter+shall not be used to construe this License against a Contributor.++10. Versions of the License+---------------------------++10.1. New Versions++Mozilla Foundation is the license steward. Except as provided in Section+10.3, no one other than the license steward has the right to modify or+publish new versions of this License. Each version will be given a+distinguishing version number.++10.2. Effect of New Versions++You may distribute the Covered Software under the terms of the version+of the License under which You originally received the Covered Software,+or under the terms of any subsequent version published by the license+steward.++10.3. Modified Versions++If you create software not governed by this License, and you want to+create a new license for such software, you may create and use a+modified version of this License if you rename the license and remove+any references to the name of the license steward (except to note that+such modified license differs from this License).++10.4. Distributing Source Code Form that is Incompatible With Secondary+Licenses++If You choose to distribute Source Code Form that is Incompatible With+Secondary Licenses under the terms of this version of the License, the+notice described in Exhibit B of this License must be attached.++Exhibit A - Source Code Form License Notice+-------------------------------------------++  This Source Code Form is subject to the terms of the Mozilla Public+  License, v. 2.0. If a copy of the MPL was not distributed with this+  file, You can obtain one at http://mozilla.org/MPL/2.0/.++If it is not possible or desirable to put the notice in a particular+file, then You may include the notice in a location (such as a LICENSE+file in a relevant directory) where a recipient would be likely to look+for such a notice.++You may add additional accurate notices of copyright ownership.++Exhibit B - "Incompatible With Secondary Licenses" Notice+---------------------------------------------------------++  This Source Code Form is "Incompatible With Secondary Licenses", as+  defined by the Mozilla Public License, v. 2.0.
+ README.md view
@@ -0,0 +1,26 @@+# Amazon CloudWatch SDK++> _Warning:_ This is an experimental preview release which is still under heavy development and not intended for public consumption, _caveat emptor_!++* [description](#description)+* [Contribute](#contribute)+* [Licence](#licence)++## 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.++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-cloudwatch)+and [AWS API Reference](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html).+++## Contribute++For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/amazonka/issues).++> _Note:_ this library is an auto-generated Haskell package. Please see `amazonka-gen` for more information.+++## Licence++`amazonka-cloudwatch` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ amazonka-cloudwatch.cabal view
@@ -0,0 +1,61 @@+name:                  amazonka-cloudwatch+version:               0.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+category:              Network, AWS, Cloud+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.+    .+    /See:/ <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/Welcome.html AWS API Reference>+    .+    /Warning:/ This is an experimental preview release which is still under+    heavy development and not intended for public consumption, caveat emptor!++source-repository head+    type:     git+    location: git://github.com/brendanhay/amazonka.git++library+    default-language:  Haskell2010+    hs-source-dirs:    src gen++    ghc-options:       -Wall++    exposed-modules:+          Network.AWS.CloudWatch+        , Network.AWS.CloudWatch.DeleteAlarms+        , Network.AWS.CloudWatch.DescribeAlarmHistory+        , Network.AWS.CloudWatch.DescribeAlarms+        , Network.AWS.CloudWatch.DescribeAlarmsForMetric+        , Network.AWS.CloudWatch.DisableAlarmActions+        , Network.AWS.CloudWatch.EnableAlarmActions+        , Network.AWS.CloudWatch.GetMetricStatistics+        , Network.AWS.CloudWatch.ListMetrics+        , Network.AWS.CloudWatch.PutMetricAlarm+        , Network.AWS.CloudWatch.PutMetricData+        , Network.AWS.CloudWatch.SetAlarmState+        , Network.AWS.CloudWatch.Types++    other-modules:++    build-depends:+          amazonka-core+        , base          >= 4.7 && < 5
+ gen/Network/AWS/CloudWatch.hs view
@@ -0,0 +1,47 @@+-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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.+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+    , module Network.AWS.CloudWatch.EnableAlarmActions+    , module Network.AWS.CloudWatch.GetMetricStatistics+    , module Network.AWS.CloudWatch.ListMetrics+    , module Network.AWS.CloudWatch.PutMetricAlarm+    , module Network.AWS.CloudWatch.PutMetricData+    , module Network.AWS.CloudWatch.SetAlarmState+    , module Network.AWS.CloudWatch.Types+    ) 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
+ gen/Network/AWS/CloudWatch/DeleteAlarms.hs view
@@ -0,0 +1,94 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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>+module Network.AWS.CloudWatch.DeleteAlarms+    (+    -- * Request+      DeleteAlarms+    -- ** Request constructor+    , deleteAlarms+    -- ** Request lenses+    , da1AlarmNames++    -- * Response+    , DeleteAlarmsResponse+    -- ** Response constructor+    , 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 "AlarmNames" Text+    } deriving (Eq, Ord, Show, Monoid, Semigroup)++instance GHC.Exts.IsList DeleteAlarms where+    type Item DeleteAlarms = Text++    fromList = DeleteAlarms . GHC.Exts.fromList+    toList   = GHC.Exts.toList . _da1AlarmNames++-- | 'DeleteAlarms' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'da1AlarmNames' @::@ ['Text']+--+deleteAlarms :: DeleteAlarms+deleteAlarms = DeleteAlarms+    { _da1AlarmNames = mempty+    }++-- | A list of alarms to be deleted.+da1AlarmNames :: Lens' DeleteAlarms [Text]+da1AlarmNames = lens _da1AlarmNames (\s a -> s { _da1AlarmNames = a }) . _List++data DeleteAlarmsResponse = DeleteAlarmsResponse+    deriving (Eq, Ord, Show, Generic)++-- | 'DeleteAlarmsResponse' constructor.+deleteAlarmsResponse :: DeleteAlarmsResponse+deleteAlarmsResponse = DeleteAlarmsResponse++instance ToPath DeleteAlarms where+    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
+ gen/Network/AWS/CloudWatch/DescribeAlarmHistory.hs view
@@ -0,0 +1,177 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html>+module Network.AWS.CloudWatch.DescribeAlarmHistory+    (+    -- * Request+      DescribeAlarmHistory+    -- ** Request constructor+    , describeAlarmHistory+    -- ** Request lenses+    , dahAlarmName+    , dahEndDate+    , dahHistoryItemType+    , dahMaxRecords+    , dahNextToken+    , dahStartDate++    -- * Response+    , DescribeAlarmHistoryResponse+    -- ** Response constructor+    , describeAlarmHistoryResponse+    -- ** Response lenses+    , dahrAlarmHistoryItems+    , dahrNextToken+    ) 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 RFC822+    , _dahHistoryItemType :: Maybe Text+    , _dahMaxRecords      :: Maybe Nat+    , _dahNextToken       :: Maybe Text+    , _dahStartDate       :: Maybe RFC822+    } deriving (Eq, Ord, Show)++-- | 'DescribeAlarmHistory' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dahAlarmName' @::@ 'Maybe' 'Text'+--+-- * 'dahEndDate' @::@ 'Maybe' 'UTCTime'+--+-- * 'dahHistoryItemType' @::@ 'Maybe' 'Text'+--+-- * 'dahMaxRecords' @::@ 'Maybe' 'Natural'+--+-- * 'dahNextToken' @::@ 'Maybe' 'Text'+--+-- * 'dahStartDate' @::@ 'Maybe' 'UTCTime'+--+describeAlarmHistory :: DescribeAlarmHistory+describeAlarmHistory = DescribeAlarmHistory+    { _dahAlarmName       = Nothing+    , _dahHistoryItemType = Nothing+    , _dahStartDate       = Nothing+    , _dahEndDate         = Nothing+    , _dahMaxRecords      = Nothing+    , _dahNextToken       = Nothing+    }++-- | The name of the alarm.+dahAlarmName :: Lens' DescribeAlarmHistory (Maybe Text)+dahAlarmName = lens _dahAlarmName (\s a -> s { _dahAlarmName = a })++-- | The ending date to retrieve alarm history.+dahEndDate :: Lens' DescribeAlarmHistory (Maybe UTCTime)+dahEndDate = lens _dahEndDate (\s a -> s { _dahEndDate = a }) . mapping _Time++-- | The type of alarm histories to retrieve.+dahHistoryItemType :: Lens' DescribeAlarmHistory (Maybe Text)+dahHistoryItemType =+    lens _dahHistoryItemType (\s a -> s { _dahHistoryItemType = 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++-- | 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 starting date to retrieve alarm history.+dahStartDate :: Lens' DescribeAlarmHistory (Maybe UTCTime)+dahStartDate = lens _dahStartDate (\s a -> s { _dahStartDate = a }) . mapping _Time++data DescribeAlarmHistoryResponse = DescribeAlarmHistoryResponse+    { _dahrAlarmHistoryItems :: List "AlarmHistoryItems" AlarmHistoryItem+    , _dahrNextToken         :: Maybe Text+    } deriving (Eq, Show)++-- | 'DescribeAlarmHistoryResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dahrAlarmHistoryItems' @::@ ['AlarmHistoryItem']+--+-- * 'dahrNextToken' @::@ 'Maybe' 'Text'+--+describeAlarmHistoryResponse :: DescribeAlarmHistoryResponse+describeAlarmHistoryResponse = DescribeAlarmHistoryResponse+    { _dahrAlarmHistoryItems = mempty+    , _dahrNextToken         = Nothing+    }++-- | A list of alarm histories in JSON format.+dahrAlarmHistoryItems :: Lens' DescribeAlarmHistoryResponse [AlarmHistoryItem]+dahrAlarmHistoryItems =+    lens _dahrAlarmHistoryItems (\s a -> s { _dahrAlarmHistoryItems = a })+        . _List++-- | 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 })++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"+        <*> x .@? "NextToken"++instance AWSPager DescribeAlarmHistory where+    page rq rs+        | stop (rq ^. dahNextToken) = Nothing+        | otherwise = (\x -> rq & dahNextToken ?~ x)+            <$> (rs ^. dahrNextToken)
+ gen/Network/AWS/CloudWatch/DescribeAlarms.hs view
@@ -0,0 +1,176 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html>+module Network.AWS.CloudWatch.DescribeAlarms+    (+    -- * Request+      DescribeAlarms+    -- ** Request constructor+    , describeAlarms+    -- ** Request lenses+    , daActionPrefix+    , daAlarmNamePrefix+    , daAlarmNames+    , daMaxRecords+    , daNextToken+    , daStateValue++    -- * Response+    , DescribeAlarmsResponse+    -- ** Response constructor+    , describeAlarmsResponse+    -- ** Response lenses+    , darMetricAlarms+    , darNextToken+    ) 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 "AlarmNames" Text+    , _daMaxRecords      :: Maybe Nat+    , _daNextToken       :: Maybe Text+    , _daStateValue      :: Maybe Text+    } deriving (Eq, Ord, Show)++-- | 'DescribeAlarms' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'daActionPrefix' @::@ 'Maybe' 'Text'+--+-- * 'daAlarmNamePrefix' @::@ 'Maybe' 'Text'+--+-- * 'daAlarmNames' @::@ ['Text']+--+-- * 'daMaxRecords' @::@ 'Maybe' 'Natural'+--+-- * 'daNextToken' @::@ 'Maybe' 'Text'+--+-- * 'daStateValue' @::@ 'Maybe' 'Text'+--+describeAlarms :: DescribeAlarms+describeAlarms = DescribeAlarms+    { _daAlarmNames      = mempty+    , _daAlarmNamePrefix = Nothing+    , _daStateValue      = Nothing+    , _daActionPrefix    = Nothing+    , _daMaxRecords      = Nothing+    , _daNextToken       = Nothing+    }++-- | The action name prefix.+daActionPrefix :: Lens' DescribeAlarms (Maybe Text)+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 })++-- | A list of alarm names to retrieve information for.+daAlarmNames :: Lens' DescribeAlarms [Text]+daAlarmNames = lens _daAlarmNames (\s a -> s { _daAlarmNames = a }) . _List++-- | The maximum number of alarm descriptions to retrieve.+daMaxRecords :: Lens' DescribeAlarms (Maybe Natural)+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 })++-- | The state value to be used in matching alarms.+daStateValue :: Lens' DescribeAlarms (Maybe Text)+daStateValue = lens _daStateValue (\s a -> s { _daStateValue = a })++data DescribeAlarmsResponse = DescribeAlarmsResponse+    { _darMetricAlarms :: List "MetricAlarms" MetricAlarm+    , _darNextToken    :: Maybe Text+    } deriving (Eq, Show)++-- | 'DescribeAlarmsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'darMetricAlarms' @::@ ['MetricAlarm']+--+-- * 'darNextToken' @::@ 'Maybe' 'Text'+--+describeAlarmsResponse :: DescribeAlarmsResponse+describeAlarmsResponse = DescribeAlarmsResponse+    { _darMetricAlarms = mempty+    , _darNextToken    = Nothing+    }++-- | A list of information for the specified alarms.+darMetricAlarms :: Lens' DescribeAlarmsResponse [MetricAlarm]+darMetricAlarms = lens _darMetricAlarms (\s a -> s { _darMetricAlarms = a }) . _List++-- | 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 })++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"+        <*> x .@? "NextToken"++instance AWSPager DescribeAlarms where+    page rq rs+        | stop (rq ^. daNextToken) = Nothing+        | otherwise = (\x -> rq & daNextToken ?~ x)+            <$> (rs ^. darNextToken)
+ gen/Network/AWS/CloudWatch/DescribeAlarmsForMetric.hs view
@@ -0,0 +1,166 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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>+module Network.AWS.CloudWatch.DescribeAlarmsForMetric+    (+    -- * Request+      DescribeAlarmsForMetric+    -- ** Request constructor+    , describeAlarmsForMetric+    -- ** Request lenses+    , dafmDimensions+    , dafmMetricName+    , dafmNamespace+    , dafmPeriod+    , dafmStatistic+    , dafmUnit++    -- * Response+    , DescribeAlarmsForMetricResponse+    -- ** Response constructor+    , describeAlarmsForMetricResponse+    -- ** Response lenses+    , dafmrMetricAlarms+    ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.CloudWatch.Types+import qualified GHC.Exts++data DescribeAlarmsForMetric = DescribeAlarmsForMetric+    { _dafmDimensions :: List "Dimensions" Dimension+    , _dafmMetricName :: Text+    , _dafmNamespace  :: Text+    , _dafmPeriod     :: Maybe Nat+    , _dafmStatistic  :: Maybe Text+    , _dafmUnit       :: Maybe Text+    } deriving (Eq, Show)++-- | 'DescribeAlarmsForMetric' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dafmDimensions' @::@ ['Dimension']+--+-- * 'dafmMetricName' @::@ 'Text'+--+-- * 'dafmNamespace' @::@ 'Text'+--+-- * 'dafmPeriod' @::@ 'Maybe' 'Natural'+--+-- * 'dafmStatistic' @::@ 'Maybe' 'Text'+--+-- * 'dafmUnit' @::@ 'Maybe' 'Text'+--+describeAlarmsForMetric :: Text -- ^ 'dafmMetricName'+                        -> Text -- ^ 'dafmNamespace'+                        -> DescribeAlarmsForMetric+describeAlarmsForMetric p1 p2 = DescribeAlarmsForMetric+    { _dafmMetricName = p1+    , _dafmNamespace  = p2+    , _dafmStatistic  = Nothing+    , _dafmDimensions = mempty+    , _dafmPeriod     = Nothing+    , _dafmUnit       = Nothing+    }++-- | 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++-- | The statistic for the metric.+dafmStatistic :: Lens' DescribeAlarmsForMetric (Maybe Text)+dafmStatistic = lens _dafmStatistic (\s a -> s { _dafmStatistic = a })++-- | The unit for the metric.+dafmUnit :: Lens' DescribeAlarmsForMetric (Maybe Text)+dafmUnit = lens _dafmUnit (\s a -> s { _dafmUnit = a })++newtype DescribeAlarmsForMetricResponse = DescribeAlarmsForMetricResponse+    { _dafmrMetricAlarms :: List "MetricAlarms" MetricAlarm+    } deriving (Eq, Show, Monoid, Semigroup)++instance GHC.Exts.IsList DescribeAlarmsForMetricResponse where+    type Item DescribeAlarmsForMetricResponse = MetricAlarm++    fromList = DescribeAlarmsForMetricResponse . GHC.Exts.fromList+    toList   = GHC.Exts.toList . _dafmrMetricAlarms++-- | 'DescribeAlarmsForMetricResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'dafmrMetricAlarms' @::@ ['MetricAlarm']+--+describeAlarmsForMetricResponse :: DescribeAlarmsForMetricResponse+describeAlarmsForMetricResponse = DescribeAlarmsForMetricResponse+    { _dafmrMetricAlarms = mempty+    }++-- | 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++instance FromXML DescribeAlarmsForMetricResponse where+    parseXML = withElement "DescribeAlarmsForMetricResult" $ \x -> DescribeAlarmsForMetricResponse+        <$> x .@  "MetricAlarms"
+ gen/Network/AWS/CloudWatch/DisableAlarmActions.hs view
@@ -0,0 +1,95 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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>+module Network.AWS.CloudWatch.DisableAlarmActions+    (+    -- * Request+      DisableAlarmActions+    -- ** Request constructor+    , disableAlarmActions+    -- ** Request lenses+    , daaAlarmNames++    -- * Response+    , DisableAlarmActionsResponse+    -- ** Response constructor+    , 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 "AlarmNames" Text+    } deriving (Eq, Ord, Show, Monoid, Semigroup)++instance GHC.Exts.IsList DisableAlarmActions where+    type Item DisableAlarmActions = Text++    fromList = DisableAlarmActions . GHC.Exts.fromList+    toList   = GHC.Exts.toList . _daaAlarmNames++-- | 'DisableAlarmActions' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'daaAlarmNames' @::@ ['Text']+--+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++data DisableAlarmActionsResponse = DisableAlarmActionsResponse+    deriving (Eq, Ord, Show, Generic)++-- | 'DisableAlarmActionsResponse' constructor.+disableAlarmActionsResponse :: DisableAlarmActionsResponse+disableAlarmActionsResponse = DisableAlarmActionsResponse++instance ToPath DisableAlarmActions where+    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
+ gen/Network/AWS/CloudWatch/EnableAlarmActions.hs view
@@ -0,0 +1,93 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | Enables actions for the specified alarms.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_EnableAlarmActions.html>+module Network.AWS.CloudWatch.EnableAlarmActions+    (+    -- * Request+      EnableAlarmActions+    -- ** Request constructor+    , enableAlarmActions+    -- ** Request lenses+    , eaaAlarmNames++    -- * Response+    , EnableAlarmActionsResponse+    -- ** Response constructor+    , 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 "AlarmNames" Text+    } deriving (Eq, Ord, Show, Monoid, Semigroup)++instance GHC.Exts.IsList EnableAlarmActions where+    type Item EnableAlarmActions = Text++    fromList = EnableAlarmActions . GHC.Exts.fromList+    toList   = GHC.Exts.toList . _eaaAlarmNames++-- | 'EnableAlarmActions' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'eaaAlarmNames' @::@ ['Text']+--+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++data EnableAlarmActionsResponse = EnableAlarmActionsResponse+    deriving (Eq, Ord, Show, Generic)++-- | 'EnableAlarmActionsResponse' constructor.+enableAlarmActionsResponse :: EnableAlarmActionsResponse+enableAlarmActionsResponse = EnableAlarmActionsResponse++instance ToPath EnableAlarmActions where+    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
+ gen/Network/AWS/CloudWatch/GetMetricStatistics.hs view
@@ -0,0 +1,220 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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. 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: 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+-- Amazon CloudWatch Metrics, Namespaces, and Dimensions Reference in the+-- Amazon CloudWatch Developer Guide.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html>+module Network.AWS.CloudWatch.GetMetricStatistics+    (+    -- * Request+      GetMetricStatistics+    -- ** Request constructor+    , getMetricStatistics+    -- ** Request lenses+    , gmsDimensions+    , gmsEndTime+    , gmsMetricName+    , gmsNamespace+    , gmsPeriod+    , gmsStartTime+    , gmsStatistics+    , gmsUnit++    -- * Response+    , GetMetricStatisticsResponse+    -- ** Response constructor+    , getMetricStatisticsResponse+    -- ** Response lenses+    , gmsrDatapoints+    , gmsrLabel+    ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.CloudWatch.Types+import qualified GHC.Exts++data GetMetricStatistics = GetMetricStatistics+    { _gmsDimensions :: List "Dimensions" Dimension+    , _gmsEndTime    :: RFC822+    , _gmsMetricName :: Text+    , _gmsNamespace  :: Text+    , _gmsPeriod     :: Nat+    , _gmsStartTime  :: RFC822+    , _gmsStatistics :: List1 "Statistics" Text+    , _gmsUnit       :: Maybe Text+    } deriving (Eq, Show)++-- | 'GetMetricStatistics' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gmsDimensions' @::@ ['Dimension']+--+-- * 'gmsEndTime' @::@ 'UTCTime'+--+-- * 'gmsMetricName' @::@ 'Text'+--+-- * 'gmsNamespace' @::@ 'Text'+--+-- * 'gmsPeriod' @::@ 'Natural'+--+-- * 'gmsStartTime' @::@ 'UTCTime'+--+-- * 'gmsStatistics' @::@ 'NonEmpty' 'Text'+--+-- * 'gmsUnit' @::@ 'Maybe' 'Text'+--+getMetricStatistics :: Text -- ^ 'gmsNamespace'+                    -> Text -- ^ 'gmsMetricName'+                    -> UTCTime -- ^ 'gmsStartTime'+                    -> UTCTime -- ^ 'gmsEndTime'+                    -> Natural -- ^ 'gmsPeriod'+                    -> NonEmpty Text -- ^ '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+    }++-- | 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++-- | The name of the metric, with or without spaces.+gmsMetricName :: Lens' GetMetricStatistics Text+gmsMetricName = lens _gmsMetricName (\s a -> s { _gmsMetricName = a })++-- | The namespace of the metric, with or without spaces.+gmsNamespace :: Lens' GetMetricStatistics Text+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 time stamp to use for determining the first datapoint to return. The+-- 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++-- | The metric statistics to return. For information about specific+-- statistics returned by GetMetricStatistics, go to Statistics in the+-- Amazon CloudWatch Developer Guide. Valid Values: Average | Sum |+-- SampleCount | Maximum | Minimum.+gmsStatistics :: Lens' GetMetricStatistics (NonEmpty Text)+gmsStatistics = lens _gmsStatistics (\s a -> s { _gmsStatistics = a }) . _List1++-- | The unit for the metric.+gmsUnit :: Lens' GetMetricStatistics (Maybe Text)+gmsUnit = lens _gmsUnit (\s a -> s { _gmsUnit = a })++data GetMetricStatisticsResponse = GetMetricStatisticsResponse+    { _gmsrDatapoints :: List "Datapoints" Datapoint+    , _gmsrLabel      :: Maybe Text+    } deriving (Eq, Show)++-- | 'GetMetricStatisticsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'gmsrDatapoints' @::@ ['Datapoint']+--+-- * 'gmsrLabel' @::@ 'Maybe' 'Text'+--+getMetricStatisticsResponse :: GetMetricStatisticsResponse+getMetricStatisticsResponse = GetMetricStatisticsResponse+    { _gmsrLabel      = Nothing+    , _gmsrDatapoints = mempty+    }++-- | The datapoints for the specified metric.+gmsrDatapoints :: Lens' GetMetricStatisticsResponse [Datapoint]+gmsrDatapoints = lens _gmsrDatapoints (\s a -> s { _gmsrDatapoints = a }) . _List++-- | 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++instance FromXML GetMetricStatisticsResponse where+    parseXML = withElement "GetMetricStatisticsResult" $ \x -> GetMetricStatisticsResponse+        <$> x .@  "Datapoints"+        <*> x .@? "Label"
+ gen/Network/AWS/CloudWatch/ListMetrics.hs view
@@ -0,0 +1,154 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html>+module Network.AWS.CloudWatch.ListMetrics+    (+    -- * Request+      ListMetrics+    -- ** Request constructor+    , listMetrics+    -- ** Request lenses+    , lmDimensions+    , lmMetricName+    , lmNamespace+    , lmNextToken++    -- * Response+    , ListMetricsResponse+    -- ** Response constructor+    , listMetricsResponse+    -- ** Response lenses+    , lmrMetrics+    , lmrNextToken+    ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.CloudWatch.Types+import qualified GHC.Exts++data ListMetrics = ListMetrics+    { _lmDimensions :: List "Dimensions" DimensionFilter+    , _lmMetricName :: Maybe Text+    , _lmNamespace  :: Maybe Text+    , _lmNextToken  :: Maybe Text+    } deriving (Eq, Show)++-- | 'ListMetrics' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lmDimensions' @::@ ['DimensionFilter']+--+-- * 'lmMetricName' @::@ 'Maybe' 'Text'+--+-- * 'lmNamespace' @::@ 'Maybe' 'Text'+--+-- * 'lmNextToken' @::@ 'Maybe' 'Text'+--+listMetrics :: ListMetrics+listMetrics = ListMetrics+    { _lmNamespace  = Nothing+    , _lmMetricName = Nothing+    , _lmDimensions = mempty+    , _lmNextToken  = 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 })++-- | The namespace to filter against.+lmNamespace :: Lens' ListMetrics (Maybe Text)+lmNamespace = lens _lmNamespace (\s a -> s { _lmNamespace = a })++-- | 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 })++data ListMetricsResponse = ListMetricsResponse+    { _lmrMetrics   :: List "Metrics" Metric+    , _lmrNextToken :: Maybe Text+    } deriving (Eq, Show)++-- | 'ListMetricsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'lmrMetrics' @::@ ['Metric']+--+-- * 'lmrNextToken' @::@ 'Maybe' 'Text'+--+listMetricsResponse :: ListMetricsResponse+listMetricsResponse = ListMetricsResponse+    { _lmrMetrics   = mempty+    , _lmrNextToken = Nothing+    }++-- | 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++-- | 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 "/"++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"+        <*> x .@? "NextToken"++instance AWSPager ListMetrics where+    page rq rs+        | stop (rq ^. lmNextToken) = Nothing+        | otherwise = (\x -> rq & lmNextToken ?~ x)+            <$> (rs ^. lmrNextToken)
+ gen/Network/AWS/CloudWatch/PutMetricAlarm.hs view
@@ -0,0 +1,262 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html>+module Network.AWS.CloudWatch.PutMetricAlarm+    (+    -- * Request+      PutMetricAlarm+    -- ** Request constructor+    , putMetricAlarm+    -- ** Request lenses+    , pmaActionsEnabled+    , pmaAlarmActions+    , pmaAlarmDescription+    , pmaAlarmName+    , pmaComparisonOperator+    , pmaDimensions+    , pmaEvaluationPeriods+    , pmaInsufficientDataActions+    , pmaMetricName+    , pmaNamespace+    , pmaOKActions+    , pmaPeriod+    , pmaStatistic+    , pmaThreshold+    , pmaUnit++    -- * Response+    , PutMetricAlarmResponse+    -- ** Response constructor+    , putMetricAlarmResponse+    ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.CloudWatch.Types+import qualified GHC.Exts++data PutMetricAlarm = PutMetricAlarm+    { _pmaActionsEnabled          :: Maybe Bool+    , _pmaAlarmActions            :: List "OKActions" Text+    , _pmaAlarmDescription        :: Maybe Text+    , _pmaAlarmName               :: Text+    , _pmaComparisonOperator      :: Text+    , _pmaDimensions              :: List "Dimensions" Dimension+    , _pmaEvaluationPeriods       :: Nat+    , _pmaInsufficientDataActions :: List "OKActions" Text+    , _pmaMetricName              :: Text+    , _pmaNamespace               :: Text+    , _pmaOKActions               :: List "OKActions" Text+    , _pmaPeriod                  :: Nat+    , _pmaStatistic               :: Text+    , _pmaThreshold               :: Double+    , _pmaUnit                    :: Maybe Text+    } deriving (Eq, Show)++-- | 'PutMetricAlarm' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'pmaActionsEnabled' @::@ 'Maybe' 'Bool'+--+-- * 'pmaAlarmActions' @::@ ['Text']+--+-- * 'pmaAlarmDescription' @::@ 'Maybe' 'Text'+--+-- * 'pmaAlarmName' @::@ 'Text'+--+-- * 'pmaComparisonOperator' @::@ 'Text'+--+-- * 'pmaDimensions' @::@ ['Dimension']+--+-- * 'pmaEvaluationPeriods' @::@ 'Natural'+--+-- * 'pmaInsufficientDataActions' @::@ ['Text']+--+-- * 'pmaMetricName' @::@ 'Text'+--+-- * 'pmaNamespace' @::@ 'Text'+--+-- * 'pmaOKActions' @::@ ['Text']+--+-- * 'pmaPeriod' @::@ 'Natural'+--+-- * 'pmaStatistic' @::@ 'Text'+--+-- * 'pmaThreshold' @::@ 'Double'+--+-- * 'pmaUnit' @::@ 'Maybe' 'Text'+--+putMetricAlarm :: Text -- ^ 'pmaAlarmName'+               -> Text -- ^ 'pmaMetricName'+               -> Text -- ^ 'pmaNamespace'+               -> Text -- ^ 'pmaStatistic'+               -> Natural -- ^ 'pmaPeriod'+               -> Natural -- ^ 'pmaEvaluationPeriods'+               -> Double -- ^ 'pmaThreshold'+               -> Text -- ^ '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+    }++-- | 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 })++-- | 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 arithmetic operation to use when comparing the specified Statistic+-- and Threshold. The specified Statistic value is used as the first+-- operand.+pmaComparisonOperator :: Lens' PutMetricAlarm Text+pmaComparisonOperator =+    lens _pmaComparisonOperator (\s a -> s { _pmaComparisonOperator = a })++-- | The dimensions for the alarm's associated metric.+pmaDimensions :: Lens' PutMetricAlarm [Dimension]+pmaDimensions = lens _pmaDimensions (\s a -> s { _pmaDimensions = a }) . _List++-- | 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+-- 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 name for the alarm's associated metric.+pmaMetricName :: Lens' PutMetricAlarm Text+pmaMetricName = lens _pmaMetricName (\s a -> s { _pmaMetricName = a })++-- | The namespace for the alarm's associated metric.+pmaNamespace :: Lens' PutMetricAlarm Text+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 period in seconds over which the specified statistic is applied.+pmaPeriod :: Lens' PutMetricAlarm Natural+pmaPeriod = lens _pmaPeriod (\s a -> s { _pmaPeriod = a }) . _Nat++-- | The statistic to apply to the alarm's associated metric.+pmaStatistic :: Lens' PutMetricAlarm Text+pmaStatistic = lens _pmaStatistic (\s a -> s { _pmaStatistic = a })++-- | The value against which the specified statistic is compared.+pmaThreshold :: Lens' PutMetricAlarm Double+pmaThreshold = lens _pmaThreshold (\s a -> s { _pmaThreshold = a })++-- | The unit for the alarm's associated metric.+pmaUnit :: Lens' PutMetricAlarm (Maybe Text)+pmaUnit = lens _pmaUnit (\s a -> s { _pmaUnit = a })++data PutMetricAlarmResponse = PutMetricAlarmResponse+    deriving (Eq, Ord, Show, Generic)++-- | 'PutMetricAlarmResponse' constructor.+putMetricAlarmResponse :: PutMetricAlarmResponse+putMetricAlarmResponse = PutMetricAlarmResponse++instance ToPath PutMetricAlarm where+    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+        ]++instance ToHeaders PutMetricAlarm++instance AWSRequest PutMetricAlarm where+    type Sv PutMetricAlarm = CloudWatch+    type Rs PutMetricAlarm = PutMetricAlarmResponse++    request  = post "PutMetricAlarm"+    response = nullResponse PutMetricAlarmResponse
+ gen/Network/AWS/CloudWatch/PutMetricData.hs view
@@ -0,0 +1,109 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html>+module Network.AWS.CloudWatch.PutMetricData+    (+    -- * Request+      PutMetricData+    -- ** Request constructor+    , putMetricData+    -- ** Request lenses+    , pmdMetricData+    , pmdNamespace++    -- * Response+    , PutMetricDataResponse+    -- ** Response constructor+    , putMetricDataResponse+    ) where++import Network.AWS.Prelude+import Network.AWS.Request.Query+import Network.AWS.CloudWatch.Types+import qualified GHC.Exts++data PutMetricData = PutMetricData+    { _pmdMetricData :: List "MetricData" MetricDatum+    , _pmdNamespace  :: Text+    } deriving (Eq, Show)++-- | 'PutMetricData' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'pmdMetricData' @::@ ['MetricDatum']+--+-- * 'pmdNamespace' @::@ 'Text'+--+putMetricData :: Text -- ^ 'pmdNamespace'+              -> PutMetricData+putMetricData p1 = PutMetricData+    { _pmdNamespace  = p1+    , _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 })++data PutMetricDataResponse = PutMetricDataResponse+    deriving (Eq, Ord, Show, Generic)++-- | 'PutMetricDataResponse' constructor.+putMetricDataResponse :: PutMetricDataResponse+putMetricDataResponse = PutMetricDataResponse++instance ToPath PutMetricData where+    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
+ gen/Network/AWS/CloudWatch/SetAlarmState.hs view
@@ -0,0 +1,127 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++-- | 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>+module Network.AWS.CloudWatch.SetAlarmState+    (+    -- * Request+      SetAlarmState+    -- ** Request constructor+    , setAlarmState+    -- ** Request lenses+    , sasAlarmName+    , sasStateReason+    , sasStateReasonData+    , sasStateValue++    -- * Response+    , SetAlarmStateResponse+    -- ** Response constructor+    , 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      :: Text+    } deriving (Eq, Ord, Show)++-- | 'SetAlarmState' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'sasAlarmName' @::@ 'Text'+--+-- * 'sasStateReason' @::@ 'Text'+--+-- * 'sasStateReasonData' @::@ 'Maybe' 'Text'+--+-- * 'sasStateValue' @::@ 'Text'+--+setAlarmState :: Text -- ^ 'sasAlarmName'+              -> Text -- ^ 'sasStateValue'+              -> Text -- ^ 'sasStateReason'+              -> SetAlarmState+setAlarmState p1 p2 p3 = SetAlarmState+    { _sasAlarmName       = p1+    , _sasStateValue      = p2+    , _sasStateReason     = p3+    , _sasStateReasonData = Nothing+    }++-- | 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 })++-- | The value of the state.+sasStateValue :: Lens' SetAlarmState Text+sasStateValue = lens _sasStateValue (\s a -> s { _sasStateValue = a })++data SetAlarmStateResponse = SetAlarmStateResponse+    deriving (Eq, Ord, Show, Generic)++-- | 'SetAlarmStateResponse' constructor.+setAlarmStateResponse :: SetAlarmStateResponse+setAlarmStateResponse = SetAlarmStateResponse++instance ToPath SetAlarmState where+    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
+ gen/Network/AWS/CloudWatch/Types.hs view
@@ -0,0 +1,1067 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- 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/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)++module Network.AWS.CloudWatch.Types+    (+    -- * Service+      CloudWatch+    -- ** Error+    , RESTError+    -- ** XML+    , ns++    -- * StatisticSet+    , StatisticSet+    , statisticSet+    , ssMaximum+    , ssMinimum+    , ssSampleCount+    , ssSum++    -- * MetricAlarm+    , MetricAlarm+    , metricAlarm+    , maActionsEnabled+    , maAlarmActions+    , maAlarmArn+    , maAlarmConfigurationUpdatedTimestamp+    , maAlarmDescription+    , maAlarmName+    , maComparisonOperator+    , maDimensions+    , maEvaluationPeriods+    , maInsufficientDataActions+    , maMetricName+    , maNamespace+    , maOKActions+    , maPeriod+    , maStateReason+    , maStateReasonData+    , maStateUpdatedTimestamp+    , maStateValue+    , maStatistic+    , maThreshold+    , maUnit++    -- * HistoryItemType+    , HistoryItemType (..)++    -- * MetricDatum+    , MetricDatum+    , metricDatum+    , mdDimensions+    , mdMetricName+    , mdStatisticValues+    , mdTimestamp+    , mdUnit+    , mdValue++    -- * StandardUnit+    , StandardUnit (..)++    -- * Dimension+    , Dimension+    , dimension+    , dName+    , dValue++    -- * ComparisonOperator+    , ComparisonOperator (..)++    -- * AlarmHistoryItem+    , AlarmHistoryItem+    , alarmHistoryItem+    , ahiAlarmName+    , ahiHistoryData+    , ahiHistoryItemType+    , ahiHistorySummary+    , ahiTimestamp++    -- * Metric+    , Metric+    , metric+    , mDimensions+    , mMetricName+    , mNamespace++    -- * StateValue+    , StateValue (..)++    -- * Datapoint+    , Datapoint+    , datapoint+    , dAverage+    , dMaximum+    , dMinimum+    , dSampleCount+    , dSum+    , dTimestamp+    , dUnit++    -- * DimensionFilter+    , DimensionFilter+    , dimensionFilter+    , dfName+    , dfValue++    -- * Statistic+    , Statistic (..)+    ) where++import Network.AWS.Error+import Network.AWS.Prelude+import Network.AWS.Signing.V4+import qualified GHC.Exts++-- | Version @2010-08-01@ of the Amazon CloudWatch service.+data CloudWatch++instance AWSService CloudWatch where+    type Sg CloudWatch = V4+    type Er CloudWatch = RESTError++    service = Service+        { _svcEndpoint     = regional+        , _svcAbbrev       = "CloudWatch"+        , _svcPrefix       = "monitoring"+        , _svcVersion      = "2010-08-01"+        , _svcTargetPrefix = Nothing+        , _svcJSONVersion  = Nothing+        }++    handle = restError statusSuccess++ns :: Text+ns = "http://monitoring.amazonaws.com/doc/2010-08-01/"++data StatisticSet = StatisticSet+    { _ssMaximum     :: Double+    , _ssMinimum     :: Double+    , _ssSampleCount :: Double+    , _ssSum         :: Double+    } deriving (Eq, Ord, 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 "OKActions" Text+    , _maAlarmArn                           :: Maybe Text+    , _maAlarmConfigurationUpdatedTimestamp :: Maybe RFC822+    , _maAlarmDescription                   :: Maybe Text+    , _maAlarmName                          :: Maybe Text+    , _maComparisonOperator                 :: Maybe Text+    , _maDimensions                         :: List "Dimensions" Dimension+    , _maEvaluationPeriods                  :: Maybe Nat+    , _maInsufficientDataActions            :: List "OKActions" Text+    , _maMetricName                         :: Maybe Text+    , _maNamespace                          :: Maybe Text+    , _maOKActions                          :: List "OKActions" Text+    , _maPeriod                             :: Maybe Nat+    , _maStateReason                        :: Maybe Text+    , _maStateReasonData                    :: Maybe Text+    , _maStateUpdatedTimestamp              :: Maybe RFC822+    , _maStateValue                         :: Maybe Text+    , _maStatistic                          :: Maybe Text+    , _maThreshold                          :: Maybe Double+    , _maUnit                               :: Maybe Text+    } deriving (Eq, 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' 'Text'+--+-- * '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' 'Text'+--+-- * 'maStatistic' @::@ 'Maybe' 'Text'+--+-- * 'maThreshold' @::@ 'Maybe' 'Double'+--+-- * 'maUnit' @::@ 'Maybe' 'Text'+--+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 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 Text)+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 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 Text)+maStateValue = lens _maStateValue (\s a -> s { _maStateValue = a })++-- | The statistic to apply to the alarm's associated metric.+maStatistic :: Lens' MetricAlarm (Maybe Text)+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 Text)+maUnit = lens _maUnit (\s a -> s { _maUnit = a })++instance FromXML MetricAlarm where+    parseXML x = MetricAlarm+        <$> x .@? "ActionsEnabled"+        <*> x .@  "AlarmActions"+        <*> x .@? "AlarmArn"+        <*> x .@? "AlarmConfigurationUpdatedTimestamp"+        <*> x .@? "AlarmDescription"+        <*> x .@? "AlarmName"+        <*> x .@? "ComparisonOperator"+        <*> x .@  "Dimensions"+        <*> x .@? "EvaluationPeriods"+        <*> x .@  "InsufficientDataActions"+        <*> x .@? "MetricName"+        <*> x .@? "Namespace"+        <*> x .@  "OKActions"+        <*> 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, Show, Generic, Enum)++instance Hashable HistoryItemType++instance FromText HistoryItemType where+    parser = match "Action"              Action+         <|> match "ConfigurationUpdate" ConfigurationUpdate+         <|> match "StateUpdate"         StateUpdate++instance ToText HistoryItemType where+    toText = \case+        Action              -> "Action"+        ConfigurationUpdate -> "ConfigurationUpdate"+        StateUpdate         -> "StateUpdate"++instance FromXML HistoryItemType where+    parseXML = parseXMLText "HistoryItemType"++instance ToQuery HistoryItemType where+    toQuery = toQuery . toText++data MetricDatum = MetricDatum+    { _mdDimensions      :: List "Dimensions" Dimension+    , _mdMetricName      :: Text+    , _mdStatisticValues :: Maybe StatisticSet+    , _mdTimestamp       :: Maybe RFC822+    , _mdUnit            :: Maybe Text+    , _mdValue           :: Maybe Double+    } deriving (Eq, Show)++-- | 'MetricDatum' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'mdDimensions' @::@ ['Dimension']+--+-- * 'mdMetricName' @::@ 'Text'+--+-- * 'mdStatisticValues' @::@ 'Maybe' 'StatisticSet'+--+-- * 'mdTimestamp' @::@ 'Maybe' 'UTCTime'+--+-- * 'mdUnit' @::@ 'Maybe' 'Text'+--+-- * '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 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 Text)+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"+        <*> 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, Show, Generic, Enum)++instance Hashable StandardUnit++instance FromText StandardUnit where+    parser = match "Bits"             Bits+         <|> match "Bits/Second"      BitsSecond+         <|> match "Bytes"            Bytes+         <|> match "Bytes/Second"     BytesSecond+         <|> match "Count"            Count+         <|> match "Count/Second"     CountSecond+         <|> match "Gigabits"         Gigabits+         <|> match "Gigabits/Second"  GigabitsSecond+         <|> match "Gigabytes"        Gigabytes+         <|> match "Gigabytes/Second" GigabytesSecond+         <|> match "Kilobits"         Kilobits+         <|> match "Kilobits/Second"  KilobitsSecond+         <|> match "Kilobytes"        Kilobytes+         <|> match "Kilobytes/Second" KilobytesSecond+         <|> match "Megabits"         Megabits+         <|> match "Megabits/Second"  MegabitsSecond+         <|> match "Megabytes"        Megabytes+         <|> match "Megabytes/Second" MegabytesSecond+         <|> match "Microseconds"     Microseconds+         <|> match "Milliseconds"     Milliseconds+         <|> match "None"             None+         <|> match "Percent"          Percent+         <|> match "Seconds"          Seconds+         <|> match "Terabits"         Terabits+         <|> match "Terabits/Second"  TerabitsSecond+         <|> match "Terabytes"        Terabytes+         <|> match "Terabytes/Second" TerabytesSecond++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 FromXML StandardUnit where+    parseXML = parseXMLText "StandardUnit"++instance ToQuery StandardUnit where+    toQuery = toQuery . toText++data Dimension = Dimension+    { _dName  :: Text+    , _dValue :: Text+    } deriving (Eq, Ord, 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, Show, Generic, Enum)++instance Hashable ComparisonOperator++instance FromText ComparisonOperator where+    parser = match "GreaterThanOrEqualToThreshold" GreaterThanOrEqualToThreshold+         <|> match "GreaterThanThreshold"          GreaterThanThreshold+         <|> match "LessThanOrEqualToThreshold"    LessThanOrEqualToThreshold+         <|> match "LessThanThreshold"             LessThanThreshold++instance ToText ComparisonOperator where+    toText = \case+        GreaterThanOrEqualToThreshold -> "GreaterThanOrEqualToThreshold"+        GreaterThanThreshold          -> "GreaterThanThreshold"+        LessThanOrEqualToThreshold    -> "LessThanOrEqualToThreshold"+        LessThanThreshold             -> "LessThanThreshold"++instance FromXML ComparisonOperator where+    parseXML = parseXMLText "ComparisonOperator"++instance ToQuery ComparisonOperator where+    toQuery = toQuery . toText++data AlarmHistoryItem = AlarmHistoryItem+    { _ahiAlarmName       :: Maybe Text+    , _ahiHistoryData     :: Maybe Text+    , _ahiHistoryItemType :: Maybe Text+    , _ahiHistorySummary  :: Maybe Text+    , _ahiTimestamp       :: Maybe RFC822+    } deriving (Eq, Ord, Show)++-- | 'AlarmHistoryItem' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'ahiAlarmName' @::@ 'Maybe' 'Text'+--+-- * 'ahiHistoryData' @::@ 'Maybe' 'Text'+--+-- * 'ahiHistoryItemType' @::@ 'Maybe' 'Text'+--+-- * '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 Text)+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 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 "Dimensions" Dimension+    , _mMetricName :: Maybe Text+    , _mNamespace  :: Maybe Text+    } deriving (Eq, 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"+        <*> 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, Show, Generic, Enum)++instance Hashable StateValue++instance FromText StateValue where+    parser = match "ALARM"             Alarm+         <|> match "INSUFFICIENT_DATA" InsufficientData+         <|> match "OK"                Ok++instance ToText StateValue where+    toText = \case+        Alarm            -> "ALARM"+        InsufficientData -> "INSUFFICIENT_DATA"+        Ok               -> "OK"++instance FromXML StateValue where+    parseXML = parseXMLText "StateValue"++instance ToQuery StateValue where+    toQuery = toQuery . toText++data Datapoint = Datapoint+    { _dAverage     :: Maybe Double+    , _dMaximum     :: Maybe Double+    , _dMinimum     :: Maybe Double+    , _dSampleCount :: Maybe Double+    , _dSum         :: Maybe Double+    , _dTimestamp   :: Maybe RFC822+    , _dUnit        :: Maybe Text+    } deriving (Eq, Ord, 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' 'Text'+--+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 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 Text)+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, 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, Show, Generic, Enum)++instance Hashable Statistic++instance FromText Statistic where+    parser = match "Average"     Average+         <|> match "Maximum"     Maximum+         <|> match "Minimum"     Minimum+         <|> match "SampleCount" SampleCount+         <|> match "Sum"         Sum++instance ToText Statistic where+    toText = \case+        Average     -> "Average"+        Maximum     -> "Maximum"+        Minimum     -> "Minimum"+        SampleCount -> "SampleCount"+        Sum         -> "Sum"++instance FromXML Statistic where+    parseXML = parseXMLText "Statistic"++instance ToQuery Statistic where+    toQuery = toQuery . toText