amazonka-cost-explorer (empty) → 1.6.0
raw patch · 32 files changed
+4683/−0 lines, 32 filesdep +amazonka-coredep +amazonka-cost-explorerdep +amazonka-testsetup-changed
Dependencies added: amazonka-core, amazonka-cost-explorer, amazonka-test, base, bytestring, tasty, tasty-hunit, text, time, unordered-containers
Files
- LICENSE +367/−0
- README.md +45/−0
- Setup.hs +2/−0
- amazonka-cost-explorer.cabal +91/−0
- fixture/GetCostAndUsage.yaml +10/−0
- fixture/GetCostAndUsageResponse.proto +0/−0
- fixture/GetDimensionValues.yaml +10/−0
- fixture/GetDimensionValuesResponse.proto +0/−0
- fixture/GetReservationCoverage.yaml +10/−0
- fixture/GetReservationCoverageResponse.proto +0/−0
- fixture/GetReservationPurchaseRecommendation.yaml +10/−0
- fixture/GetReservationPurchaseRecommendationResponse.proto +0/−0
- fixture/GetReservationUtilization.yaml +10/−0
- fixture/GetReservationUtilizationResponse.proto +0/−0
- fixture/GetTags.yaml +10/−0
- fixture/GetTagsResponse.proto +0/−0
- gen/Network/AWS/CostExplorer.hs +335/−0
- gen/Network/AWS/CostExplorer/GetCostAndUsage.hs +208/−0
- gen/Network/AWS/CostExplorer/GetDimensionValues.hs +212/−0
- gen/Network/AWS/CostExplorer/GetReservationCoverage.hs +231/−0
- gen/Network/AWS/CostExplorer/GetReservationPurchaseRecommendation.hs +258/−0
- gen/Network/AWS/CostExplorer/GetReservationUtilization.hs +200/−0
- gen/Network/AWS/CostExplorer/GetTags.hs +199/−0
- gen/Network/AWS/CostExplorer/Types.hs +330/−0
- gen/Network/AWS/CostExplorer/Types/Product.hs +1589/−0
- gen/Network/AWS/CostExplorer/Types/Sum.hs +338/−0
- gen/Network/AWS/CostExplorer/Waiters.hs +21/−0
- src/.gitkeep +0/−0
- test/Main.hs +21/−0
- test/Test/AWS/CostExplorer.hs +20/−0
- test/Test/AWS/CostExplorer/Internal.hs +9/−0
- test/Test/AWS/Gen/CostExplorer.hs +147/−0
+ LICENSE view
@@ -0,0 +1,367 @@+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.
+ README.md view
@@ -0,0 +1,45 @@+# Amazon Cost Explorer Service SDK++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version++`1.6.0`+++## Description++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-cost-explorer)+and the [AWS API Reference](https://aws.amazon.com/documentation/).++The types from this library are intended to be used with [amazonka](http://hackage.haskell.org/package/amazonka),+which provides mechanisms for specifying AuthN/AuthZ information, sending requests,+and receiving responses.++Lenses are used for constructing and manipulating types,+due to the depth of nesting of AWS types and transparency regarding+de/serialisation into more palatable Haskell values.+The provided lenses should be compatible with any of the major lens libraries+[lens](http://hackage.haskell.org/package/lens) or [lens-family-core](http://hackage.haskell.org/package/lens-family-core).++See [Network.AWS.CostExplorer](http://hackage.haskell.org/package/amazonka-cost-explorer/docs/Network-AWS-CostExplorer.html)+or [the AWS documentation](https://aws.amazon.com/documentation/) to get started.+++## 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-cost-explorer` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).++Parts of the code are derived from AWS service descriptions, licensed under Apache 2.0.+Source files subject to this contain an additional licensing clause in their header.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ amazonka-cost-explorer.cabal view
@@ -0,0 +1,91 @@+name: amazonka-cost-explorer+version: 1.6.0+synopsis: Amazon Cost Explorer Service SDK.+homepage: https://github.com/brendanhay/amazonka+bug-reports: https://github.com/brendanhay/amazonka/issues+license: MPL-2.0+license-file: LICENSE+author: Brendan Hay+maintainer: Brendan Hay <brendan.g.hay+amazonka@gmail.com>+copyright: Copyright (c) 2013-2018 Brendan Hay+category: Network, AWS, Cloud, Distributed Computing+build-type: Simple+cabal-version: >= 1.10+extra-source-files: README.md fixture/*.yaml fixture/*.proto src/.gitkeep+description:+ The types from this library are intended to be used with+ <http://hackage.haskell.org/package/amazonka amazonka>, which provides+ mechanisms for specifying AuthN/AuthZ information, sending requests,+ and receiving responses.+ .+ Lenses are used for constructing and manipulating types,+ due to the depth of nesting of AWS types and transparency regarding+ de/serialisation into more palatable Haskell values.+ The provided lenses should be compatible with any of the major lens libraries+ such as <http://hackage.haskell.org/package/lens lens> or+ <http://hackage.haskell.org/package/lens-family-core lens-family-core>.+ .+ See "Network.AWS.CostExplorer" or <https://aws.amazon.com/documentation/ the AWS documentation>+ to get started.++source-repository head+ type: git+ location: git://github.com/brendanhay/amazonka.git+ subdir: amazonka-cost-explorer++library+ default-language: Haskell2010+ hs-source-dirs: src gen++ ghc-options:+ -Wall+ -fwarn-incomplete-uni-patterns+ -fwarn-incomplete-record-updates+ -funbox-strict-fields++ exposed-modules:+ Network.AWS.CostExplorer+ , Network.AWS.CostExplorer.GetCostAndUsage+ , Network.AWS.CostExplorer.GetDimensionValues+ , Network.AWS.CostExplorer.GetReservationCoverage+ , Network.AWS.CostExplorer.GetReservationPurchaseRecommendation+ , Network.AWS.CostExplorer.GetReservationUtilization+ , Network.AWS.CostExplorer.GetTags+ , Network.AWS.CostExplorer.Types+ , Network.AWS.CostExplorer.Waiters++ other-modules:+ Network.AWS.CostExplorer.Types.Product+ , Network.AWS.CostExplorer.Types.Sum++ build-depends:+ amazonka-core == 1.6.0.*+ , base >= 4.7 && < 5++test-suite amazonka-cost-explorer-test+ type: exitcode-stdio-1.0+ default-language: Haskell2010+ hs-source-dirs: test+ main-is: Main.hs++ ghc-options: -Wall -threaded++ -- This section is encoded by the template and any modules added by+ -- hand outside these namespaces will not correctly be added to the+ -- distribution package.+ other-modules:+ Test.AWS.CostExplorer+ , Test.AWS.Gen.CostExplorer+ , Test.AWS.CostExplorer.Internal++ build-depends:+ amazonka-core == 1.6.0.*+ , amazonka-test == 1.6.0.*+ , amazonka-cost-explorer+ , base+ , bytestring+ , tasty+ , tasty-hunit+ , text+ , time+ , unordered-containers
+ fixture/GetCostAndUsage.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/ce/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: ce.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/GetCostAndUsageResponse.proto view
+ fixture/GetDimensionValues.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/ce/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: ce.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/GetDimensionValuesResponse.proto view
+ fixture/GetReservationCoverage.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/ce/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: ce.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/GetReservationCoverageResponse.proto view
+ fixture/GetReservationPurchaseRecommendation.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/ce/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: ce.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/GetReservationPurchaseRecommendationResponse.proto view
+ fixture/GetReservationUtilization.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/ce/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: ce.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/GetReservationUtilizationResponse.proto view
+ fixture/GetTags.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/ce/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: ce.us-east-1.amazonaws.com+ Content-Type: application/x-www-form-urlencoded; charset=utf-8+ X-Amz-Content-SHA256: abcdef+ X-Amz-Date: 20091028T223200Z+body:+ ''
+ fixture/GetTagsResponse.proto view
+ gen/Network/AWS/CostExplorer.hs view
@@ -0,0 +1,335 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- The Cost Explorer API allows you to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data, such as the number of daily write operations for Amazon DynamoDB database tables in your production environment.+--+--+-- Service Endpoint+--+-- The Cost Explorer API provides the following endpoint:+--+-- * https://ce.us-east-1.amazonaws.com+--+--+--+-- For information about costs associated with the Cost Explorer API, see <https://aws.amazon.com/aws-cost-management/pricing/ AWS Cost Management Pricing> .+--+module Network.AWS.CostExplorer+ (+ -- * Service Configuration+ costExplorer++ -- * Errors+ -- $errors++ -- ** BillExpirationException+ , _BillExpirationException++ -- ** RequestChangedException+ , _RequestChangedException++ -- ** InvalidNextTokenException+ , _InvalidNextTokenException++ -- ** DataUnavailableException+ , _DataUnavailableException++ -- ** LimitExceededException+ , _LimitExceededException++ -- * Waiters+ -- $waiters++ -- * Operations+ -- $operations++ -- ** GetReservationUtilization+ , module Network.AWS.CostExplorer.GetReservationUtilization++ -- ** GetTags+ , module Network.AWS.CostExplorer.GetTags++ -- ** GetReservationCoverage+ , module Network.AWS.CostExplorer.GetReservationCoverage++ -- ** GetDimensionValues+ , module Network.AWS.CostExplorer.GetDimensionValues++ -- ** GetReservationPurchaseRecommendation+ , module Network.AWS.CostExplorer.GetReservationPurchaseRecommendation++ -- ** GetCostAndUsage+ , module Network.AWS.CostExplorer.GetCostAndUsage++ -- * Types++ -- ** AccountScope+ , AccountScope (..)++ -- ** Context+ , Context (..)++ -- ** Dimension+ , Dimension (..)++ -- ** Granularity+ , Granularity (..)++ -- ** GroupDefinitionType+ , GroupDefinitionType (..)++ -- ** LookbackPeriodInDays+ , LookbackPeriodInDays (..)++ -- ** OfferingClass+ , OfferingClass (..)++ -- ** PaymentOption+ , PaymentOption (..)++ -- ** TermInYears+ , TermInYears (..)++ -- ** Coverage+ , Coverage+ , coverage+ , cCoverageHours++ -- ** CoverageByTime+ , CoverageByTime+ , coverageByTime+ , cbtGroups+ , cbtTimePeriod+ , cbtTotal++ -- ** CoverageHours+ , CoverageHours+ , coverageHours+ , chCoverageHoursPercentage+ , chOnDemandHours+ , chTotalRunningHours+ , chReservedHours++ -- ** DateInterval+ , DateInterval+ , dateInterval+ , diStart+ , diEnd++ -- ** DimensionValues+ , DimensionValues+ , dimensionValues+ , dvValues+ , dvKey++ -- ** DimensionValuesWithAttributes+ , DimensionValuesWithAttributes+ , dimensionValuesWithAttributes+ , dvwaValue+ , dvwaAttributes++ -- ** EC2InstanceDetails+ , EC2InstanceDetails+ , ec2InstanceDetails+ , eidCurrentGeneration+ , eidPlatform+ , eidFamily+ , eidInstanceType+ , eidAvailabilityZone+ , eidSizeFlexEligible+ , eidTenancy+ , eidRegion++ -- ** EC2Specification+ , EC2Specification+ , ec2Specification+ , esOfferingClass++ -- ** Expression+ , Expression+ , expression+ , eNot+ , eAnd+ , eOr+ , eDimensions+ , eTags++ -- ** Group+ , Group+ , group'+ , gMetrics+ , gKeys++ -- ** GroupDefinition+ , GroupDefinition+ , groupDefinition+ , gdKey+ , gdType++ -- ** InstanceDetails+ , InstanceDetails+ , instanceDetails+ , idRDSInstanceDetails+ , idEC2InstanceDetails++ -- ** MetricValue+ , MetricValue+ , metricValue+ , mvAmount+ , mvUnit++ -- ** RDSInstanceDetails+ , RDSInstanceDetails+ , rdsInstanceDetails+ , ridCurrentGeneration+ , ridDeploymentOption+ , ridFamily+ , ridInstanceType+ , ridLicenseModel+ , ridSizeFlexEligible+ , ridRegion+ , ridDatabaseEngine++ -- ** ReservationAggregates+ , ReservationAggregates+ , reservationAggregates+ , raPurchasedHours+ , raTotalActualHours+ , raUtilizationPercentage+ , raUnusedHours++ -- ** ReservationCoverageGroup+ , ReservationCoverageGroup+ , reservationCoverageGroup+ , rcgCoverage+ , rcgAttributes++ -- ** ReservationPurchaseRecommendation+ , ReservationPurchaseRecommendation+ , reservationPurchaseRecommendation+ , rprTermInYears+ , rprRecommendationSummary+ , rprServiceSpecification+ , rprAccountScope+ , rprRecommendationDetails+ , rprLookbackPeriodInDays+ , rprPaymentOption++ -- ** ReservationPurchaseRecommendationDetail+ , ReservationPurchaseRecommendationDetail+ , reservationPurchaseRecommendationDetail+ , rprdMaximumNormalizedUnitsUsedPerHour+ , rprdRecurringStandardMonthlyCost+ , rprdAverageNormalizedUnitsUsedPerHour+ , rprdCurrencyCode+ , rprdEstimatedMonthlySavingsPercentage+ , rprdRecommendedNormalizedUnitsToPurchase+ , rprdAverageUtilization+ , rprdEstimatedMonthlySavingsAmount+ , rprdUpfrontCost+ , rprdMinimumNormalizedUnitsUsedPerHour+ , rprdEstimatedMonthlyOnDemandCost+ , rprdRecommendedNumberOfInstancesToPurchase+ , rprdMaximumNumberOfInstancesUsedPerHour+ , rprdEstimatedReservationCostForLookbackPeriod+ , rprdInstanceDetails+ , rprdAverageNumberOfInstancesUsedPerHour+ , rprdMinimumNumberOfInstancesUsedPerHour+ , rprdEstimatedBreakEvenInMonths++ -- ** ReservationPurchaseRecommendationMetadata+ , ReservationPurchaseRecommendationMetadata+ , reservationPurchaseRecommendationMetadata+ , rprmRecommendationId+ , rprmGenerationTimestamp++ -- ** ReservationPurchaseRecommendationSummary+ , ReservationPurchaseRecommendationSummary+ , reservationPurchaseRecommendationSummary+ , rprsCurrencyCode+ , rprsTotalEstimatedMonthlySavingsPercentage+ , rprsTotalEstimatedMonthlySavingsAmount++ -- ** ReservationUtilizationGroup+ , ReservationUtilizationGroup+ , reservationUtilizationGroup+ , rugValue+ , rugKey+ , rugAttributes+ , rugUtilization++ -- ** ResultByTime+ , ResultByTime+ , resultByTime+ , rbtGroups+ , rbtTimePeriod+ , rbtTotal+ , rbtEstimated++ -- ** ServiceSpecification+ , ServiceSpecification+ , serviceSpecification+ , ssEC2Specification++ -- ** TagValues+ , TagValues+ , tagValues+ , tvValues+ , tvKey++ -- ** UtilizationByTime+ , UtilizationByTime+ , utilizationByTime+ , ubtGroups+ , ubtTimePeriod+ , ubtTotal+ ) where++import Network.AWS.CostExplorer.GetCostAndUsage+import Network.AWS.CostExplorer.GetDimensionValues+import Network.AWS.CostExplorer.GetReservationCoverage+import Network.AWS.CostExplorer.GetReservationPurchaseRecommendation+import Network.AWS.CostExplorer.GetReservationUtilization+import Network.AWS.CostExplorer.GetTags+import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Waiters++{- $errors+Error matchers are designed for use with the functions provided by+<http://hackage.haskell.org/package/lens/docs/Control-Exception-Lens.html Control.Exception.Lens>.+This allows catching (and rethrowing) service specific errors returned+by 'CostExplorer'.+-}++{- $operations+Some AWS operations return results that are incomplete and require subsequent+requests in order to obtain the entire result set. The process of sending+subsequent requests to continue where a previous request left off is called+pagination. For example, the 'ListObjects' operation of Amazon S3 returns up to+1000 objects at a time, and you must send subsequent requests with the+appropriate Marker in order to retrieve the next page of results.++Operations that have an 'AWSPager' instance can transparently perform subsequent+requests, correctly setting Markers and other request facets to iterate through+the entire result set of a truncated API operation. Operations which support+this have an additional note in the documentation.++Many operations have the ability to filter results on the server side. See the+individual operation parameters for details.+-}++{- $waiters+Waiters poll by repeatedly sending a request until some remote success condition+configured by the 'Wait' specification is fulfilled. The 'Wait' specification+determines how many attempts should be made, in addition to delay and retry strategies.+-}
+ gen/Network/AWS/CostExplorer/GetCostAndUsage.hs view
@@ -0,0 +1,208 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.GetCostAndUsage+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric, such as @BlendedCosts@ or @UsageQuantity@ , that you want the request to return. You can also filter and group your data by various dimensions, such as @SERVICE@ or @AZ@ , in a specific time range. For a complete list of valid dimensions, see the @<http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetDimensionValues.html GetDimensionValues> @ operation. Master accounts in an organization in AWS Organizations have access to all member accounts.+--+--+module Network.AWS.CostExplorer.GetCostAndUsage+ (+ -- * Creating a Request+ getCostAndUsage+ , GetCostAndUsage+ -- * Request Lenses+ , gcauGroupBy+ , gcauNextPageToken+ , gcauMetrics+ , gcauTimePeriod+ , gcauGranularity+ , gcauFilter++ -- * Destructuring the Response+ , getCostAndUsageResponse+ , GetCostAndUsageResponse+ -- * Response Lenses+ , gcaursResultsByTime+ , gcaursNextPageToken+ , gcaursGroupDefinitions+ , gcaursResponseStatus+ ) where++import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response++-- | /See:/ 'getCostAndUsage' smart constructor.+data GetCostAndUsage = GetCostAndUsage'+ { _gcauGroupBy :: !(Maybe [GroupDefinition])+ , _gcauNextPageToken :: !(Maybe Text)+ , _gcauMetrics :: !(Maybe [Text])+ , _gcauTimePeriod :: !(Maybe DateInterval)+ , _gcauGranularity :: !(Maybe Granularity)+ , _gcauFilter :: !(Maybe Expression)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetCostAndUsage' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gcauGroupBy' - You can group AWS costs using up to two different groups, either dimensions, tag keys, or both. When you group by tag key, you get all tag values, including empty strings. Valid values are @AZ@ , @INSTANCE_TYPE@ , @LEGAL_ENTITY_NAME@ , @LINKED_ACCOUNT@ , @OPERATION@ , @PLATFORM@ , @PURCHASE_TYPE@ , @SERVICE@ , @TAGS@ , @TENANCY@ , and @USAGE_TYPE@ .+--+-- * 'gcauNextPageToken' - The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gcauMetrics' - Which metrics are returned in the query. For more information about blended and unblended rates, see <https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/ Why does the "blended" annotation appear on some line items in my bill?> . Valid values are @BlendedCost@ , @UnblendedCost@ , and @UsageQuantity@ . @Metrics@ is required for @GetCostAndUsage@ requests.+--+-- * 'gcauTimePeriod' - Sets the start and end dates for retrieving AWS costs. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+--+-- * 'gcauGranularity' - Sets the AWS cost granularity to @MONTHLY@ or @DAILY@ . If @Granularity@ isn't set, the response object doesn't include the @Granularity@ , either @MONTHLY@ or @DAILY@ .+--+-- * 'gcauFilter' - Filters AWS costs by different dimensions. For example, you can specify @SERVICE@ and @LINKED_ACCOUNT@ and get the costs that are associated with that account's usage of that service. You can nest @Expression@ objects to define any combination of dimension filters. For more information, see <http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression> .+getCostAndUsage+ :: GetCostAndUsage+getCostAndUsage =+ GetCostAndUsage'+ { _gcauGroupBy = Nothing+ , _gcauNextPageToken = Nothing+ , _gcauMetrics = Nothing+ , _gcauTimePeriod = Nothing+ , _gcauGranularity = Nothing+ , _gcauFilter = Nothing+ }+++-- | You can group AWS costs using up to two different groups, either dimensions, tag keys, or both. When you group by tag key, you get all tag values, including empty strings. Valid values are @AZ@ , @INSTANCE_TYPE@ , @LEGAL_ENTITY_NAME@ , @LINKED_ACCOUNT@ , @OPERATION@ , @PLATFORM@ , @PURCHASE_TYPE@ , @SERVICE@ , @TAGS@ , @TENANCY@ , and @USAGE_TYPE@ .+gcauGroupBy :: Lens' GetCostAndUsage [GroupDefinition]+gcauGroupBy = lens _gcauGroupBy (\ s a -> s{_gcauGroupBy = a}) . _Default . _Coerce++-- | The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gcauNextPageToken :: Lens' GetCostAndUsage (Maybe Text)+gcauNextPageToken = lens _gcauNextPageToken (\ s a -> s{_gcauNextPageToken = a})++-- | Which metrics are returned in the query. For more information about blended and unblended rates, see <https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/ Why does the "blended" annotation appear on some line items in my bill?> . Valid values are @BlendedCost@ , @UnblendedCost@ , and @UsageQuantity@ . @Metrics@ is required for @GetCostAndUsage@ requests.+gcauMetrics :: Lens' GetCostAndUsage [Text]+gcauMetrics = lens _gcauMetrics (\ s a -> s{_gcauMetrics = a}) . _Default . _Coerce++-- | Sets the start and end dates for retrieving AWS costs. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+gcauTimePeriod :: Lens' GetCostAndUsage (Maybe DateInterval)+gcauTimePeriod = lens _gcauTimePeriod (\ s a -> s{_gcauTimePeriod = a})++-- | Sets the AWS cost granularity to @MONTHLY@ or @DAILY@ . If @Granularity@ isn't set, the response object doesn't include the @Granularity@ , either @MONTHLY@ or @DAILY@ .+gcauGranularity :: Lens' GetCostAndUsage (Maybe Granularity)+gcauGranularity = lens _gcauGranularity (\ s a -> s{_gcauGranularity = a})++-- | Filters AWS costs by different dimensions. For example, you can specify @SERVICE@ and @LINKED_ACCOUNT@ and get the costs that are associated with that account's usage of that service. You can nest @Expression@ objects to define any combination of dimension filters. For more information, see <http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression> .+gcauFilter :: Lens' GetCostAndUsage (Maybe Expression)+gcauFilter = lens _gcauFilter (\ s a -> s{_gcauFilter = a})++instance AWSRequest GetCostAndUsage where+ type Rs GetCostAndUsage = GetCostAndUsageResponse+ request = postJSON costExplorer+ response+ = receiveJSON+ (\ s h x ->+ GetCostAndUsageResponse' <$>+ (x .?> "ResultsByTime" .!@ mempty) <*>+ (x .?> "NextPageToken")+ <*> (x .?> "GroupDefinitions" .!@ mempty)+ <*> (pure (fromEnum s)))++instance Hashable GetCostAndUsage where++instance NFData GetCostAndUsage where++instance ToHeaders GetCostAndUsage where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSInsightsIndexService.GetCostAndUsage" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetCostAndUsage where+ toJSON GetCostAndUsage'{..}+ = object+ (catMaybes+ [("GroupBy" .=) <$> _gcauGroupBy,+ ("NextPageToken" .=) <$> _gcauNextPageToken,+ ("Metrics" .=) <$> _gcauMetrics,+ ("TimePeriod" .=) <$> _gcauTimePeriod,+ ("Granularity" .=) <$> _gcauGranularity,+ ("Filter" .=) <$> _gcauFilter])++instance ToPath GetCostAndUsage where+ toPath = const "/"++instance ToQuery GetCostAndUsage where+ toQuery = const mempty++-- | /See:/ 'getCostAndUsageResponse' smart constructor.+data GetCostAndUsageResponse = GetCostAndUsageResponse'+ { _gcaursResultsByTime :: !(Maybe [ResultByTime])+ , _gcaursNextPageToken :: !(Maybe Text)+ , _gcaursGroupDefinitions :: !(Maybe [GroupDefinition])+ , _gcaursResponseStatus :: !Int+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetCostAndUsageResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gcaursResultsByTime' - The time period that is covered by the results in the response.+--+-- * 'gcaursNextPageToken' - The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gcaursGroupDefinitions' - The groups that are specified by the @Filter@ or @GroupBy@ parameters in the request.+--+-- * 'gcaursResponseStatus' - -- | The response status code.+getCostAndUsageResponse+ :: Int -- ^ 'gcaursResponseStatus'+ -> GetCostAndUsageResponse+getCostAndUsageResponse pResponseStatus_ =+ GetCostAndUsageResponse'+ { _gcaursResultsByTime = Nothing+ , _gcaursNextPageToken = Nothing+ , _gcaursGroupDefinitions = Nothing+ , _gcaursResponseStatus = pResponseStatus_+ }+++-- | The time period that is covered by the results in the response.+gcaursResultsByTime :: Lens' GetCostAndUsageResponse [ResultByTime]+gcaursResultsByTime = lens _gcaursResultsByTime (\ s a -> s{_gcaursResultsByTime = a}) . _Default . _Coerce++-- | The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gcaursNextPageToken :: Lens' GetCostAndUsageResponse (Maybe Text)+gcaursNextPageToken = lens _gcaursNextPageToken (\ s a -> s{_gcaursNextPageToken = a})++-- | The groups that are specified by the @Filter@ or @GroupBy@ parameters in the request.+gcaursGroupDefinitions :: Lens' GetCostAndUsageResponse [GroupDefinition]+gcaursGroupDefinitions = lens _gcaursGroupDefinitions (\ s a -> s{_gcaursGroupDefinitions = a}) . _Default . _Coerce++-- | -- | The response status code.+gcaursResponseStatus :: Lens' GetCostAndUsageResponse Int+gcaursResponseStatus = lens _gcaursResponseStatus (\ s a -> s{_gcaursResponseStatus = a})++instance NFData GetCostAndUsageResponse where
+ gen/Network/AWS/CostExplorer/GetDimensionValues.hs view
@@ -0,0 +1,212 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.GetDimensionValues+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string.+--+--+module Network.AWS.CostExplorer.GetDimensionValues+ (+ -- * Creating a Request+ getDimensionValues+ , GetDimensionValues+ -- * Request Lenses+ , gdvNextPageToken+ , gdvContext+ , gdvSearchString+ , gdvTimePeriod+ , gdvDimension++ -- * Destructuring the Response+ , getDimensionValuesResponse+ , GetDimensionValuesResponse+ -- * Response Lenses+ , gdvrsNextPageToken+ , gdvrsResponseStatus+ , gdvrsDimensionValues+ , gdvrsReturnSize+ , gdvrsTotalSize+ ) where++import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response++-- | /See:/ 'getDimensionValues' smart constructor.+data GetDimensionValues = GetDimensionValues'+ { _gdvNextPageToken :: !(Maybe Text)+ , _gdvContext :: !(Maybe Context)+ , _gdvSearchString :: !(Maybe Text)+ , _gdvTimePeriod :: !DateInterval+ , _gdvDimension :: !Dimension+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetDimensionValues' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gdvNextPageToken' - The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gdvContext' - The context for the call to @GetDimensionValues@ . This can be @RESERVATIONS@ or @COST_AND_USAGE@ . The default value is @COST_AND_USAGE@ . If the context is set to @RESERVATIONS@ , the resulting dimension values can be used in the @GetReservationUtilization@ operation. If the context is set to @COST_AND_USAGE@ the resulting dimension values can be used in the @GetCostAndUsage@ operation. If you set the context to @COST_AND_USAGE@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL. * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LEGAL_ENTITY_NAME - The name of the organization that sells you AWS services, such as Amazon Web Services. * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * OPERATING_SYSTEM - The operating system. Examples are Windows or Linux. * OPERATION - The action performed. Examples include @RunInstance@ and @CreateBucket@ . * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances. * SERVICE - The AWS service such as Amazon DynamoDB. * USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the @GetDimensionValues@ operation includes a unit attribute. Examples include GB and Hrs. * USAGE_TYPE_GROUP - The grouping of common usage types. An example is EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute. * RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits. If you set the context to @RESERVATIONS@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux. * DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are @SingleAZ@ and @MultiAZ@ . * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * REGION - The AWS Region. * SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone. * TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI). * TENANCY - The tenancy of a resource. Examples are shared or dedicated.+--+-- * 'gdvSearchString' - The value that you want to search the filter values for.+--+-- * 'gdvTimePeriod' - The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+--+-- * 'gdvDimension' - The name of the dimension. Each @Dimension@ is available for different a @Context@ . For more information, see @Context@ .+getDimensionValues+ :: DateInterval -- ^ 'gdvTimePeriod'+ -> Dimension -- ^ 'gdvDimension'+ -> GetDimensionValues+getDimensionValues pTimePeriod_ pDimension_ =+ GetDimensionValues'+ { _gdvNextPageToken = Nothing+ , _gdvContext = Nothing+ , _gdvSearchString = Nothing+ , _gdvTimePeriod = pTimePeriod_+ , _gdvDimension = pDimension_+ }+++-- | The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gdvNextPageToken :: Lens' GetDimensionValues (Maybe Text)+gdvNextPageToken = lens _gdvNextPageToken (\ s a -> s{_gdvNextPageToken = a})++-- | The context for the call to @GetDimensionValues@ . This can be @RESERVATIONS@ or @COST_AND_USAGE@ . The default value is @COST_AND_USAGE@ . If the context is set to @RESERVATIONS@ , the resulting dimension values can be used in the @GetReservationUtilization@ operation. If the context is set to @COST_AND_USAGE@ the resulting dimension values can be used in the @GetCostAndUsage@ operation. If you set the context to @COST_AND_USAGE@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL. * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LEGAL_ENTITY_NAME - The name of the organization that sells you AWS services, such as Amazon Web Services. * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * OPERATING_SYSTEM - The operating system. Examples are Windows or Linux. * OPERATION - The action performed. Examples include @RunInstance@ and @CreateBucket@ . * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances. * SERVICE - The AWS service such as Amazon DynamoDB. * USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the @GetDimensionValues@ operation includes a unit attribute. Examples include GB and Hrs. * USAGE_TYPE_GROUP - The grouping of common usage types. An example is EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute. * RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits. If you set the context to @RESERVATIONS@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux. * DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are @SingleAZ@ and @MultiAZ@ . * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * REGION - The AWS Region. * SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone. * TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI). * TENANCY - The tenancy of a resource. Examples are shared or dedicated.+gdvContext :: Lens' GetDimensionValues (Maybe Context)+gdvContext = lens _gdvContext (\ s a -> s{_gdvContext = a})++-- | The value that you want to search the filter values for.+gdvSearchString :: Lens' GetDimensionValues (Maybe Text)+gdvSearchString = lens _gdvSearchString (\ s a -> s{_gdvSearchString = a})++-- | The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+gdvTimePeriod :: Lens' GetDimensionValues DateInterval+gdvTimePeriod = lens _gdvTimePeriod (\ s a -> s{_gdvTimePeriod = a})++-- | The name of the dimension. Each @Dimension@ is available for different a @Context@ . For more information, see @Context@ .+gdvDimension :: Lens' GetDimensionValues Dimension+gdvDimension = lens _gdvDimension (\ s a -> s{_gdvDimension = a})++instance AWSRequest GetDimensionValues where+ type Rs GetDimensionValues =+ GetDimensionValuesResponse+ request = postJSON costExplorer+ response+ = receiveJSON+ (\ s h x ->+ GetDimensionValuesResponse' <$>+ (x .?> "NextPageToken") <*> (pure (fromEnum s)) <*>+ (x .?> "DimensionValues" .!@ mempty)+ <*> (x .:> "ReturnSize")+ <*> (x .:> "TotalSize"))++instance Hashable GetDimensionValues where++instance NFData GetDimensionValues where++instance ToHeaders GetDimensionValues where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSInsightsIndexService.GetDimensionValues" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetDimensionValues where+ toJSON GetDimensionValues'{..}+ = object+ (catMaybes+ [("NextPageToken" .=) <$> _gdvNextPageToken,+ ("Context" .=) <$> _gdvContext,+ ("SearchString" .=) <$> _gdvSearchString,+ Just ("TimePeriod" .= _gdvTimePeriod),+ Just ("Dimension" .= _gdvDimension)])++instance ToPath GetDimensionValues where+ toPath = const "/"++instance ToQuery GetDimensionValues where+ toQuery = const mempty++-- | /See:/ 'getDimensionValuesResponse' smart constructor.+data GetDimensionValuesResponse = GetDimensionValuesResponse'+ { _gdvrsNextPageToken :: !(Maybe Text)+ , _gdvrsResponseStatus :: !Int+ , _gdvrsDimensionValues :: ![DimensionValuesWithAttributes]+ , _gdvrsReturnSize :: !Int+ , _gdvrsTotalSize :: !Int+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetDimensionValuesResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gdvrsNextPageToken' - The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gdvrsResponseStatus' - -- | The response status code.+--+-- * 'gdvrsDimensionValues' - The filters that you used to filter your request. Some dimensions are available only for a specific context: If you set the context to @COST_AND_USAGE@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL. * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LEGAL_ENTITY_NAME - The name of the organization that sells you AWS services, such as Amazon Web Services. * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * OPERATING_SYSTEM - The operating system. Examples are Windows or Linux. * OPERATION - The action performed. Examples include @RunInstance@ and @CreateBucket@ . * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances. * SERVICE - The AWS service such as Amazon DynamoDB. * USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the @GetDimensionValues@ operation includes a unit attribute. Examples include GB and Hrs. * USAGE_TYPE_GROUP - The grouping of common usage types. An example is EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute. * RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits. If you set the context to @RESERVATIONS@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux. * DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are @SingleAZ@ and @MultiAZ@ . * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * REGION - The AWS Region. * SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone. * TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI). * TENANCY - The tenancy of a resource. Examples are shared or dedicated.+--+-- * 'gdvrsReturnSize' - The number of results that AWS returned at one time.+--+-- * 'gdvrsTotalSize' - The total number of search results.+getDimensionValuesResponse+ :: Int -- ^ 'gdvrsResponseStatus'+ -> Int -- ^ 'gdvrsReturnSize'+ -> Int -- ^ 'gdvrsTotalSize'+ -> GetDimensionValuesResponse+getDimensionValuesResponse pResponseStatus_ pReturnSize_ pTotalSize_ =+ GetDimensionValuesResponse'+ { _gdvrsNextPageToken = Nothing+ , _gdvrsResponseStatus = pResponseStatus_+ , _gdvrsDimensionValues = mempty+ , _gdvrsReturnSize = pReturnSize_+ , _gdvrsTotalSize = pTotalSize_+ }+++-- | The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gdvrsNextPageToken :: Lens' GetDimensionValuesResponse (Maybe Text)+gdvrsNextPageToken = lens _gdvrsNextPageToken (\ s a -> s{_gdvrsNextPageToken = a})++-- | -- | The response status code.+gdvrsResponseStatus :: Lens' GetDimensionValuesResponse Int+gdvrsResponseStatus = lens _gdvrsResponseStatus (\ s a -> s{_gdvrsResponseStatus = a})++-- | The filters that you used to filter your request. Some dimensions are available only for a specific context: If you set the context to @COST_AND_USAGE@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL. * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LEGAL_ENTITY_NAME - The name of the organization that sells you AWS services, such as Amazon Web Services. * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * OPERATING_SYSTEM - The operating system. Examples are Windows or Linux. * OPERATION - The action performed. Examples include @RunInstance@ and @CreateBucket@ . * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On-Demand Instances and Standard Reserved Instances. * SERVICE - The AWS service such as Amazon DynamoDB. * USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the @GetDimensionValues@ operation includes a unit attribute. Examples include GB and Hrs. * USAGE_TYPE_GROUP - The grouping of common usage types. An example is EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute. * RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits. If you set the context to @RESERVATIONS@ , you can use the following dimensions for searching: * AZ - The Availability Zone. An example is @us-east-1a@ . * CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux. * DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are @SingleAZ@ and @MultiAZ@ . * INSTANCE_TYPE - The type of EC2 instance. An example is @m4.xlarge@ . * LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the AWS ID of the member account. * PLATFORM - The EC2 operating system. Examples are Windows or Linux. * REGION - The AWS Region. * SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone. * TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI). * TENANCY - The tenancy of a resource. Examples are shared or dedicated.+gdvrsDimensionValues :: Lens' GetDimensionValuesResponse [DimensionValuesWithAttributes]+gdvrsDimensionValues = lens _gdvrsDimensionValues (\ s a -> s{_gdvrsDimensionValues = a}) . _Coerce++-- | The number of results that AWS returned at one time.+gdvrsReturnSize :: Lens' GetDimensionValuesResponse Int+gdvrsReturnSize = lens _gdvrsReturnSize (\ s a -> s{_gdvrsReturnSize = a})++-- | The total number of search results.+gdvrsTotalSize :: Lens' GetDimensionValuesResponse Int+gdvrsTotalSize = lens _gdvrsTotalSize (\ s a -> s{_gdvrsTotalSize = a})++instance NFData GetDimensionValuesResponse where
+ gen/Network/AWS/CostExplorer/GetReservationCoverage.hs view
@@ -0,0 +1,231 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.GetReservationCoverage+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Retrieves the reservation coverage for your account. This allows you to see how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service, or Amazon Redshift usage is covered by a reservation. An organization's master account can see the coverage of the associated member accounts. For any time period, you can filter data about reservation usage by the following dimensions:+--+--+-- * AZ+--+-- * CACHE_ENGINE+--+-- * DATABASE_ENGINE+--+-- * DEPLOYMENT_OPTION+--+-- * INSTANCE_TYPE+--+-- * LINKED_ACCOUNT+--+-- * OPERATING_SYSTEM+--+-- * PLATFORM+--+-- * REGION+--+-- * SERVICE+--+-- * TAG+--+-- * TENANCY+--+--+--+-- To determine valid values for a dimension, use the @GetDimensionValues@ operation.+--+module Network.AWS.CostExplorer.GetReservationCoverage+ (+ -- * Creating a Request+ getReservationCoverage+ , GetReservationCoverage+ -- * Request Lenses+ , grcGroupBy+ , grcNextPageToken+ , grcGranularity+ , grcFilter+ , grcTimePeriod++ -- * Destructuring the Response+ , getReservationCoverageResponse+ , GetReservationCoverageResponse+ -- * Response Lenses+ , grcrsNextPageToken+ , grcrsTotal+ , grcrsResponseStatus+ , grcrsCoveragesByTime+ ) where++import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response++-- | You can use the following request parameters to query for how much of your instance usage is covered by a reservation.+--+--+--+-- /See:/ 'getReservationCoverage' smart constructor.+data GetReservationCoverage = GetReservationCoverage'+ { _grcGroupBy :: !(Maybe [GroupDefinition])+ , _grcNextPageToken :: !(Maybe Text)+ , _grcGranularity :: !(Maybe Granularity)+ , _grcFilter :: !(Maybe Expression)+ , _grcTimePeriod :: !DateInterval+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetReservationCoverage' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'grcGroupBy' - You can group the data by the following attributes: * AZ * CACHE_ENGINE * DATABASE_ENGINE * DEPLOYMENT_OPTION * INSTANCE_TYPE * LINKED_ACCOUNT * OPERATING_SYSTEM * PLATFORM * REGION * TAG * TENANCY+--+-- * 'grcNextPageToken' - The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'grcGranularity' - The granularity of the AWS cost data for the reservation. Valid values are @MONTHLY@ and @DAILY@ . If @GroupBy@ is set, @Granularity@ can't be set. If @Granularity@ isn't set, the response object doesn't include @Granularity@ , either @MONTHLY@ or @DAILY@ .+--+-- * 'grcFilter' - Filters utilization data by dimensions. You can filter by the following dimensions: * AZ * CACHE_ENGINE * DATABASE_ENGINE * DEPLOYMENT_OPTION * INSTANCE_TYPE * LINKED_ACCOUNT * OPERATING_SYSTEM * PLATFORM * REGION * SERVICE * TAG * TENANCY @GetReservationCoverage@ uses the same @<http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression> @ object as the other operations, but only @AND@ is supported among each dimension. You can nest only one level deep. If there are multiple values for a dimension, they are OR'd together.+--+-- * 'grcTimePeriod' - The start and end dates of the period for which you want to retrieve data about reservation coverage. You can retrieve data for a maximum of 13 months: the last 12 months and the current month. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+getReservationCoverage+ :: DateInterval -- ^ 'grcTimePeriod'+ -> GetReservationCoverage+getReservationCoverage pTimePeriod_ =+ GetReservationCoverage'+ { _grcGroupBy = Nothing+ , _grcNextPageToken = Nothing+ , _grcGranularity = Nothing+ , _grcFilter = Nothing+ , _grcTimePeriod = pTimePeriod_+ }+++-- | You can group the data by the following attributes: * AZ * CACHE_ENGINE * DATABASE_ENGINE * DEPLOYMENT_OPTION * INSTANCE_TYPE * LINKED_ACCOUNT * OPERATING_SYSTEM * PLATFORM * REGION * TAG * TENANCY+grcGroupBy :: Lens' GetReservationCoverage [GroupDefinition]+grcGroupBy = lens _grcGroupBy (\ s a -> s{_grcGroupBy = a}) . _Default . _Coerce++-- | The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+grcNextPageToken :: Lens' GetReservationCoverage (Maybe Text)+grcNextPageToken = lens _grcNextPageToken (\ s a -> s{_grcNextPageToken = a})++-- | The granularity of the AWS cost data for the reservation. Valid values are @MONTHLY@ and @DAILY@ . If @GroupBy@ is set, @Granularity@ can't be set. If @Granularity@ isn't set, the response object doesn't include @Granularity@ , either @MONTHLY@ or @DAILY@ .+grcGranularity :: Lens' GetReservationCoverage (Maybe Granularity)+grcGranularity = lens _grcGranularity (\ s a -> s{_grcGranularity = a})++-- | Filters utilization data by dimensions. You can filter by the following dimensions: * AZ * CACHE_ENGINE * DATABASE_ENGINE * DEPLOYMENT_OPTION * INSTANCE_TYPE * LINKED_ACCOUNT * OPERATING_SYSTEM * PLATFORM * REGION * SERVICE * TAG * TENANCY @GetReservationCoverage@ uses the same @<http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression> @ object as the other operations, but only @AND@ is supported among each dimension. You can nest only one level deep. If there are multiple values for a dimension, they are OR'd together.+grcFilter :: Lens' GetReservationCoverage (Maybe Expression)+grcFilter = lens _grcFilter (\ s a -> s{_grcFilter = a})++-- | The start and end dates of the period for which you want to retrieve data about reservation coverage. You can retrieve data for a maximum of 13 months: the last 12 months and the current month. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+grcTimePeriod :: Lens' GetReservationCoverage DateInterval+grcTimePeriod = lens _grcTimePeriod (\ s a -> s{_grcTimePeriod = a})++instance AWSRequest GetReservationCoverage where+ type Rs GetReservationCoverage =+ GetReservationCoverageResponse+ request = postJSON costExplorer+ response+ = receiveJSON+ (\ s h x ->+ GetReservationCoverageResponse' <$>+ (x .?> "NextPageToken") <*> (x .?> "Total") <*>+ (pure (fromEnum s))+ <*> (x .?> "CoveragesByTime" .!@ mempty))++instance Hashable GetReservationCoverage where++instance NFData GetReservationCoverage where++instance ToHeaders GetReservationCoverage where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSInsightsIndexService.GetReservationCoverage" ::+ ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetReservationCoverage where+ toJSON GetReservationCoverage'{..}+ = object+ (catMaybes+ [("GroupBy" .=) <$> _grcGroupBy,+ ("NextPageToken" .=) <$> _grcNextPageToken,+ ("Granularity" .=) <$> _grcGranularity,+ ("Filter" .=) <$> _grcFilter,+ Just ("TimePeriod" .= _grcTimePeriod)])++instance ToPath GetReservationCoverage where+ toPath = const "/"++instance ToQuery GetReservationCoverage where+ toQuery = const mempty++-- | /See:/ 'getReservationCoverageResponse' smart constructor.+data GetReservationCoverageResponse = GetReservationCoverageResponse'+ { _grcrsNextPageToken :: !(Maybe Text)+ , _grcrsTotal :: !(Maybe Coverage)+ , _grcrsResponseStatus :: !Int+ , _grcrsCoveragesByTime :: ![CoverageByTime]+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetReservationCoverageResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'grcrsNextPageToken' - The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'grcrsTotal' - The total amount of instance usage that is covered by a reservation.+--+-- * 'grcrsResponseStatus' - -- | The response status code.+--+-- * 'grcrsCoveragesByTime' - The amount of time that your reservations covered.+getReservationCoverageResponse+ :: Int -- ^ 'grcrsResponseStatus'+ -> GetReservationCoverageResponse+getReservationCoverageResponse pResponseStatus_ =+ GetReservationCoverageResponse'+ { _grcrsNextPageToken = Nothing+ , _grcrsTotal = Nothing+ , _grcrsResponseStatus = pResponseStatus_+ , _grcrsCoveragesByTime = mempty+ }+++-- | The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+grcrsNextPageToken :: Lens' GetReservationCoverageResponse (Maybe Text)+grcrsNextPageToken = lens _grcrsNextPageToken (\ s a -> s{_grcrsNextPageToken = a})++-- | The total amount of instance usage that is covered by a reservation.+grcrsTotal :: Lens' GetReservationCoverageResponse (Maybe Coverage)+grcrsTotal = lens _grcrsTotal (\ s a -> s{_grcrsTotal = a})++-- | -- | The response status code.+grcrsResponseStatus :: Lens' GetReservationCoverageResponse Int+grcrsResponseStatus = lens _grcrsResponseStatus (\ s a -> s{_grcrsResponseStatus = a})++-- | The amount of time that your reservations covered.+grcrsCoveragesByTime :: Lens' GetReservationCoverageResponse [CoverageByTime]+grcrsCoveragesByTime = lens _grcrsCoveragesByTime (\ s a -> s{_grcrsCoveragesByTime = a}) . _Coerce++instance NFData GetReservationCoverageResponse where
+ gen/Network/AWS/CostExplorer/GetReservationPurchaseRecommendation.hs view
@@ -0,0 +1,258 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.GetReservationPurchaseRecommendation+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets recommendations for which reservations to purchase. These recommendations could help you reduce your costs. Reservations provide a discounted hourly rate (up to 75%) compared to On-Demand pricing.+--+--+-- AWS generates your recommendations by identifying your On-Demand usage during a specific time period and collecting your usage into categories that are eligible for a reservation. After AWS has these categories, it simulates every combination of reservations in each category of usage to identify the best number of each type of RI to purchase to maximize your estimated savings.+--+-- For example, AWS automatically aggregates your EC2 Linux, shared tenancy, and c4 family usage in the US West (Oregon) Region and recommends that you buy size-flexible regional reservations to apply to the c4 family usage. AWS recommends the smallest size instance in an instance family. This makes it easier to purchase a size-flexible RI. AWS also shows the equal number of normalized units so that you can purchase any instance size that you want. For this example, your RI recommendation would be for @c4.large@ , because that is the smallest size instance in the c4 instance family.+--+module Network.AWS.CostExplorer.GetReservationPurchaseRecommendation+ (+ -- * Creating a Request+ getReservationPurchaseRecommendation+ , GetReservationPurchaseRecommendation+ -- * Request Lenses+ , grprNextPageToken+ , grprTermInYears+ , grprServiceSpecification+ , grprAccountScope+ , grprAccountId+ , grprPageSize+ , grprLookbackPeriodInDays+ , grprPaymentOption+ , grprService++ -- * Destructuring the Response+ , getReservationPurchaseRecommendationResponse+ , GetReservationPurchaseRecommendationResponse+ -- * Response Lenses+ , grprrsNextPageToken+ , grprrsRecommendations+ , grprrsMetadata+ , grprrsResponseStatus+ ) where++import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response++-- | /See:/ 'getReservationPurchaseRecommendation' smart constructor.+data GetReservationPurchaseRecommendation = GetReservationPurchaseRecommendation'+ { _grprNextPageToken :: !(Maybe Text)+ , _grprTermInYears :: !(Maybe TermInYears)+ , _grprServiceSpecification :: !(Maybe ServiceSpecification)+ , _grprAccountScope :: !(Maybe AccountScope)+ , _grprAccountId :: !(Maybe Text)+ , _grprPageSize :: !(Maybe Nat)+ , _grprLookbackPeriodInDays :: !(Maybe LookbackPeriodInDays)+ , _grprPaymentOption :: !(Maybe PaymentOption)+ , _grprService :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetReservationPurchaseRecommendation' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'grprNextPageToken' - The pagination token that indicates the next set of results that you want to retrieve.+--+-- * 'grprTermInYears' - The reservation term that you want recommendations for.+--+-- * 'grprServiceSpecification' - The hardware specifications for the service instances that you want recommendations for, such as standard or convertible EC2 instances.+--+-- * 'grprAccountScope' - The account scope that you want recommendations for. The only valid value is @Payer@ . This means that AWS includes the master account and any member accounts when it calculates its recommendations.+--+-- * 'grprAccountId' - The account ID that is associated with the recommendation.+--+-- * 'grprPageSize' - The number of recommendations that you want returned in a single response object.+--+-- * 'grprLookbackPeriodInDays' - The number of previous days that you want AWS to consider when it calculates your recommendations.+--+-- * 'grprPaymentOption' - The reservation purchase option that you want recommendations for.+--+-- * 'grprService' - The specific service that you want recommendations for.+getReservationPurchaseRecommendation+ :: Text -- ^ 'grprService'+ -> GetReservationPurchaseRecommendation+getReservationPurchaseRecommendation pService_ =+ GetReservationPurchaseRecommendation'+ { _grprNextPageToken = Nothing+ , _grprTermInYears = Nothing+ , _grprServiceSpecification = Nothing+ , _grprAccountScope = Nothing+ , _grprAccountId = Nothing+ , _grprPageSize = Nothing+ , _grprLookbackPeriodInDays = Nothing+ , _grprPaymentOption = Nothing+ , _grprService = pService_+ }+++-- | The pagination token that indicates the next set of results that you want to retrieve.+grprNextPageToken :: Lens' GetReservationPurchaseRecommendation (Maybe Text)+grprNextPageToken = lens _grprNextPageToken (\ s a -> s{_grprNextPageToken = a})++-- | The reservation term that you want recommendations for.+grprTermInYears :: Lens' GetReservationPurchaseRecommendation (Maybe TermInYears)+grprTermInYears = lens _grprTermInYears (\ s a -> s{_grprTermInYears = a})++-- | The hardware specifications for the service instances that you want recommendations for, such as standard or convertible EC2 instances.+grprServiceSpecification :: Lens' GetReservationPurchaseRecommendation (Maybe ServiceSpecification)+grprServiceSpecification = lens _grprServiceSpecification (\ s a -> s{_grprServiceSpecification = a})++-- | The account scope that you want recommendations for. The only valid value is @Payer@ . This means that AWS includes the master account and any member accounts when it calculates its recommendations.+grprAccountScope :: Lens' GetReservationPurchaseRecommendation (Maybe AccountScope)+grprAccountScope = lens _grprAccountScope (\ s a -> s{_grprAccountScope = a})++-- | The account ID that is associated with the recommendation.+grprAccountId :: Lens' GetReservationPurchaseRecommendation (Maybe Text)+grprAccountId = lens _grprAccountId (\ s a -> s{_grprAccountId = a})++-- | The number of recommendations that you want returned in a single response object.+grprPageSize :: Lens' GetReservationPurchaseRecommendation (Maybe Natural)+grprPageSize = lens _grprPageSize (\ s a -> s{_grprPageSize = a}) . mapping _Nat++-- | The number of previous days that you want AWS to consider when it calculates your recommendations.+grprLookbackPeriodInDays :: Lens' GetReservationPurchaseRecommendation (Maybe LookbackPeriodInDays)+grprLookbackPeriodInDays = lens _grprLookbackPeriodInDays (\ s a -> s{_grprLookbackPeriodInDays = a})++-- | The reservation purchase option that you want recommendations for.+grprPaymentOption :: Lens' GetReservationPurchaseRecommendation (Maybe PaymentOption)+grprPaymentOption = lens _grprPaymentOption (\ s a -> s{_grprPaymentOption = a})++-- | The specific service that you want recommendations for.+grprService :: Lens' GetReservationPurchaseRecommendation Text+grprService = lens _grprService (\ s a -> s{_grprService = a})++instance AWSRequest+ GetReservationPurchaseRecommendation+ where+ type Rs GetReservationPurchaseRecommendation =+ GetReservationPurchaseRecommendationResponse+ request = postJSON costExplorer+ response+ = receiveJSON+ (\ s h x ->+ GetReservationPurchaseRecommendationResponse' <$>+ (x .?> "NextPageToken") <*>+ (x .?> "Recommendations" .!@ mempty)+ <*> (x .?> "Metadata")+ <*> (pure (fromEnum s)))++instance Hashable+ GetReservationPurchaseRecommendation+ where++instance NFData GetReservationPurchaseRecommendation+ where++instance ToHeaders+ GetReservationPurchaseRecommendation+ where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSInsightsIndexService.GetReservationPurchaseRecommendation"+ :: ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetReservationPurchaseRecommendation+ where+ toJSON GetReservationPurchaseRecommendation'{..}+ = object+ (catMaybes+ [("NextPageToken" .=) <$> _grprNextPageToken,+ ("TermInYears" .=) <$> _grprTermInYears,+ ("ServiceSpecification" .=) <$>+ _grprServiceSpecification,+ ("AccountScope" .=) <$> _grprAccountScope,+ ("AccountId" .=) <$> _grprAccountId,+ ("PageSize" .=) <$> _grprPageSize,+ ("LookbackPeriodInDays" .=) <$>+ _grprLookbackPeriodInDays,+ ("PaymentOption" .=) <$> _grprPaymentOption,+ Just ("Service" .= _grprService)])++instance ToPath GetReservationPurchaseRecommendation+ where+ toPath = const "/"++instance ToQuery GetReservationPurchaseRecommendation+ where+ toQuery = const mempty++-- | /See:/ 'getReservationPurchaseRecommendationResponse' smart constructor.+data GetReservationPurchaseRecommendationResponse = GetReservationPurchaseRecommendationResponse'+ { _grprrsNextPageToken :: !(Maybe Text)+ , _grprrsRecommendations :: !(Maybe [ReservationPurchaseRecommendation])+ , _grprrsMetadata :: !(Maybe ReservationPurchaseRecommendationMetadata)+ , _grprrsResponseStatus :: !Int+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetReservationPurchaseRecommendationResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'grprrsNextPageToken' - The pagination token for the next set of retrievable results.+--+-- * 'grprrsRecommendations' - Recommendations for reservations to purchase.+--+-- * 'grprrsMetadata' - Information about this specific recommendation call, such as the time stamp for when Cost Explorer generated this recommendation.+--+-- * 'grprrsResponseStatus' - -- | The response status code.+getReservationPurchaseRecommendationResponse+ :: Int -- ^ 'grprrsResponseStatus'+ -> GetReservationPurchaseRecommendationResponse+getReservationPurchaseRecommendationResponse pResponseStatus_ =+ GetReservationPurchaseRecommendationResponse'+ { _grprrsNextPageToken = Nothing+ , _grprrsRecommendations = Nothing+ , _grprrsMetadata = Nothing+ , _grprrsResponseStatus = pResponseStatus_+ }+++-- | The pagination token for the next set of retrievable results.+grprrsNextPageToken :: Lens' GetReservationPurchaseRecommendationResponse (Maybe Text)+grprrsNextPageToken = lens _grprrsNextPageToken (\ s a -> s{_grprrsNextPageToken = a})++-- | Recommendations for reservations to purchase.+grprrsRecommendations :: Lens' GetReservationPurchaseRecommendationResponse [ReservationPurchaseRecommendation]+grprrsRecommendations = lens _grprrsRecommendations (\ s a -> s{_grprrsRecommendations = a}) . _Default . _Coerce++-- | Information about this specific recommendation call, such as the time stamp for when Cost Explorer generated this recommendation.+grprrsMetadata :: Lens' GetReservationPurchaseRecommendationResponse (Maybe ReservationPurchaseRecommendationMetadata)+grprrsMetadata = lens _grprrsMetadata (\ s a -> s{_grprrsMetadata = a})++-- | -- | The response status code.+grprrsResponseStatus :: Lens' GetReservationPurchaseRecommendationResponse Int+grprrsResponseStatus = lens _grprrsResponseStatus (\ s a -> s{_grprrsResponseStatus = a})++instance NFData+ GetReservationPurchaseRecommendationResponse+ where
+ gen/Network/AWS/CostExplorer/GetReservationUtilization.hs view
@@ -0,0 +1,200 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.GetReservationUtilization+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Retrieves the reservation utilization for your account. Master accounts in an organization have access to member accounts. You can filter data by dimensions in a time period. You can use @GetDimensionValues@ to determine the possible dimension values. Currently, you can group only by @SUBSCRIPTION_ID@ .+--+--+module Network.AWS.CostExplorer.GetReservationUtilization+ (+ -- * Creating a Request+ getReservationUtilization+ , GetReservationUtilization+ -- * Request Lenses+ , gruGroupBy+ , gruNextPageToken+ , gruGranularity+ , gruFilter+ , gruTimePeriod++ -- * Destructuring the Response+ , getReservationUtilizationResponse+ , GetReservationUtilizationResponse+ -- * Response Lenses+ , grursNextPageToken+ , grursTotal+ , grursResponseStatus+ , grursUtilizationsByTime+ ) where++import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response++-- | /See:/ 'getReservationUtilization' smart constructor.+data GetReservationUtilization = GetReservationUtilization'+ { _gruGroupBy :: !(Maybe [GroupDefinition])+ , _gruNextPageToken :: !(Maybe Text)+ , _gruGranularity :: !(Maybe Granularity)+ , _gruFilter :: !(Maybe Expression)+ , _gruTimePeriod :: !DateInterval+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetReservationUtilization' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gruGroupBy' - Groups only by @SUBSCRIPTION_ID@ . Metadata is included.+--+-- * 'gruNextPageToken' - The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gruGranularity' - If @GroupBy@ is set, @Granularity@ can't be set. If @Granularity@ isn't set, the response object doesn't include @Granularity@ , either @MONTHLY@ or @DAILY@ . If both @GroupBy@ and @Granularity@ aren't set, @GetReservationUtilization@ defaults to @DAILY@ .+--+-- * 'gruFilter' - Filters utilization data by dimensions. You can filter by the following dimensions: * AZ * CACHE_ENGINE * DATABASE_ENGINE * DEPLOYMENT_OPTION * INSTANCE_TYPE * LINKED_ACCOUNT * OPERATING_SYSTEM * PLATFORM * REGION * SERVICE * SCOPE * TENANCY @GetReservationUtilization@ uses the same @<http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression> @ object as the other operations, but only @AND@ is supported among each dimension, and nesting is supported up to only one level deep. If there are multiple values for a dimension, they are OR'd together.+--+-- * 'gruTimePeriod' - Sets the start and end dates for retrieving Reserved Instance (RI) utilization. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+getReservationUtilization+ :: DateInterval -- ^ 'gruTimePeriod'+ -> GetReservationUtilization+getReservationUtilization pTimePeriod_ =+ GetReservationUtilization'+ { _gruGroupBy = Nothing+ , _gruNextPageToken = Nothing+ , _gruGranularity = Nothing+ , _gruFilter = Nothing+ , _gruTimePeriod = pTimePeriod_+ }+++-- | Groups only by @SUBSCRIPTION_ID@ . Metadata is included.+gruGroupBy :: Lens' GetReservationUtilization [GroupDefinition]+gruGroupBy = lens _gruGroupBy (\ s a -> s{_gruGroupBy = a}) . _Default . _Coerce++-- | The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gruNextPageToken :: Lens' GetReservationUtilization (Maybe Text)+gruNextPageToken = lens _gruNextPageToken (\ s a -> s{_gruNextPageToken = a})++-- | If @GroupBy@ is set, @Granularity@ can't be set. If @Granularity@ isn't set, the response object doesn't include @Granularity@ , either @MONTHLY@ or @DAILY@ . If both @GroupBy@ and @Granularity@ aren't set, @GetReservationUtilization@ defaults to @DAILY@ .+gruGranularity :: Lens' GetReservationUtilization (Maybe Granularity)+gruGranularity = lens _gruGranularity (\ s a -> s{_gruGranularity = a})++-- | Filters utilization data by dimensions. You can filter by the following dimensions: * AZ * CACHE_ENGINE * DATABASE_ENGINE * DEPLOYMENT_OPTION * INSTANCE_TYPE * LINKED_ACCOUNT * OPERATING_SYSTEM * PLATFORM * REGION * SERVICE * SCOPE * TENANCY @GetReservationUtilization@ uses the same @<http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression> @ object as the other operations, but only @AND@ is supported among each dimension, and nesting is supported up to only one level deep. If there are multiple values for a dimension, they are OR'd together.+gruFilter :: Lens' GetReservationUtilization (Maybe Expression)+gruFilter = lens _gruFilter (\ s a -> s{_gruFilter = a})++-- | Sets the start and end dates for retrieving Reserved Instance (RI) utilization. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+gruTimePeriod :: Lens' GetReservationUtilization DateInterval+gruTimePeriod = lens _gruTimePeriod (\ s a -> s{_gruTimePeriod = a})++instance AWSRequest GetReservationUtilization where+ type Rs GetReservationUtilization =+ GetReservationUtilizationResponse+ request = postJSON costExplorer+ response+ = receiveJSON+ (\ s h x ->+ GetReservationUtilizationResponse' <$>+ (x .?> "NextPageToken") <*> (x .?> "Total") <*>+ (pure (fromEnum s))+ <*> (x .?> "UtilizationsByTime" .!@ mempty))++instance Hashable GetReservationUtilization where++instance NFData GetReservationUtilization where++instance ToHeaders GetReservationUtilization where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSInsightsIndexService.GetReservationUtilization"+ :: ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetReservationUtilization where+ toJSON GetReservationUtilization'{..}+ = object+ (catMaybes+ [("GroupBy" .=) <$> _gruGroupBy,+ ("NextPageToken" .=) <$> _gruNextPageToken,+ ("Granularity" .=) <$> _gruGranularity,+ ("Filter" .=) <$> _gruFilter,+ Just ("TimePeriod" .= _gruTimePeriod)])++instance ToPath GetReservationUtilization where+ toPath = const "/"++instance ToQuery GetReservationUtilization where+ toQuery = const mempty++-- | /See:/ 'getReservationUtilizationResponse' smart constructor.+data GetReservationUtilizationResponse = GetReservationUtilizationResponse'+ { _grursNextPageToken :: !(Maybe Text)+ , _grursTotal :: !(Maybe ReservationAggregates)+ , _grursResponseStatus :: !Int+ , _grursUtilizationsByTime :: ![UtilizationByTime]+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetReservationUtilizationResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'grursNextPageToken' - The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'grursTotal' - The total amount of time that you utilized your RIs.+--+-- * 'grursResponseStatus' - -- | The response status code.+--+-- * 'grursUtilizationsByTime' - The amount of time that you utilized your RIs.+getReservationUtilizationResponse+ :: Int -- ^ 'grursResponseStatus'+ -> GetReservationUtilizationResponse+getReservationUtilizationResponse pResponseStatus_ =+ GetReservationUtilizationResponse'+ { _grursNextPageToken = Nothing+ , _grursTotal = Nothing+ , _grursResponseStatus = pResponseStatus_+ , _grursUtilizationsByTime = mempty+ }+++-- | The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+grursNextPageToken :: Lens' GetReservationUtilizationResponse (Maybe Text)+grursNextPageToken = lens _grursNextPageToken (\ s a -> s{_grursNextPageToken = a})++-- | The total amount of time that you utilized your RIs.+grursTotal :: Lens' GetReservationUtilizationResponse (Maybe ReservationAggregates)+grursTotal = lens _grursTotal (\ s a -> s{_grursTotal = a})++-- | -- | The response status code.+grursResponseStatus :: Lens' GetReservationUtilizationResponse Int+grursResponseStatus = lens _grursResponseStatus (\ s a -> s{_grursResponseStatus = a})++-- | The amount of time that you utilized your RIs.+grursUtilizationsByTime :: Lens' GetReservationUtilizationResponse [UtilizationByTime]+grursUtilizationsByTime = lens _grursUtilizationsByTime (\ s a -> s{_grursUtilizationsByTime = a}) . _Coerce++instance NFData GetReservationUtilizationResponse+ where
+ gen/Network/AWS/CostExplorer/GetTags.hs view
@@ -0,0 +1,199 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.GetTags+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.+--+--+module Network.AWS.CostExplorer.GetTags+ (+ -- * Creating a Request+ getTags+ , GetTags+ -- * Request Lenses+ , gtNextPageToken+ , gtSearchString+ , gtTagKey+ , gtTimePeriod++ -- * Destructuring the Response+ , getTagsResponse+ , GetTagsResponse+ -- * Response Lenses+ , gtrsNextPageToken+ , gtrsResponseStatus+ , gtrsTags+ , gtrsReturnSize+ , gtrsTotalSize+ ) where++import Network.AWS.CostExplorer.Types+import Network.AWS.CostExplorer.Types.Product+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Request+import Network.AWS.Response++-- | /See:/ 'getTags' smart constructor.+data GetTags = GetTags'+ { _gtNextPageToken :: !(Maybe Text)+ , _gtSearchString :: !(Maybe Text)+ , _gtTagKey :: !(Maybe Text)+ , _gtTimePeriod :: !DateInterval+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetTags' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gtNextPageToken' - The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gtSearchString' - The value that you want to search for.+--+-- * 'gtTagKey' - The key of the tag that you want to return values for.+--+-- * 'gtTimePeriod' - The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+getTags+ :: DateInterval -- ^ 'gtTimePeriod'+ -> GetTags+getTags pTimePeriod_ =+ GetTags'+ { _gtNextPageToken = Nothing+ , _gtSearchString = Nothing+ , _gtTagKey = Nothing+ , _gtTimePeriod = pTimePeriod_+ }+++-- | The token to retrieve the next set of results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gtNextPageToken :: Lens' GetTags (Maybe Text)+gtNextPageToken = lens _gtNextPageToken (\ s a -> s{_gtNextPageToken = a})++-- | The value that you want to search for.+gtSearchString :: Lens' GetTags (Maybe Text)+gtSearchString = lens _gtSearchString (\ s a -> s{_gtSearchString = a})++-- | The key of the tag that you want to return values for.+gtTagKey :: Lens' GetTags (Maybe Text)+gtTagKey = lens _gtTagKey (\ s a -> s{_gtTagKey = a})++-- | The start and end dates for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if @start@ is @2017-01-01@ and @end@ is @2017-05-01@ , then the cost and usage data is retrieved from @2017-01-01@ up to and including @2017-04-30@ but not including @2017-05-01@ .+gtTimePeriod :: Lens' GetTags DateInterval+gtTimePeriod = lens _gtTimePeriod (\ s a -> s{_gtTimePeriod = a})++instance AWSRequest GetTags where+ type Rs GetTags = GetTagsResponse+ request = postJSON costExplorer+ response+ = receiveJSON+ (\ s h x ->+ GetTagsResponse' <$>+ (x .?> "NextPageToken") <*> (pure (fromEnum s)) <*>+ (x .?> "Tags" .!@ mempty)+ <*> (x .:> "ReturnSize")+ <*> (x .:> "TotalSize"))++instance Hashable GetTags where++instance NFData GetTags where++instance ToHeaders GetTags where+ toHeaders+ = const+ (mconcat+ ["X-Amz-Target" =#+ ("AWSInsightsIndexService.GetTags" :: ByteString),+ "Content-Type" =#+ ("application/x-amz-json-1.1" :: ByteString)])++instance ToJSON GetTags where+ toJSON GetTags'{..}+ = object+ (catMaybes+ [("NextPageToken" .=) <$> _gtNextPageToken,+ ("SearchString" .=) <$> _gtSearchString,+ ("TagKey" .=) <$> _gtTagKey,+ Just ("TimePeriod" .= _gtTimePeriod)])++instance ToPath GetTags where+ toPath = const "/"++instance ToQuery GetTags where+ toQuery = const mempty++-- | /See:/ 'getTagsResponse' smart constructor.+data GetTagsResponse = GetTagsResponse'+ { _gtrsNextPageToken :: !(Maybe Text)+ , _gtrsResponseStatus :: !Int+ , _gtrsTags :: ![Text]+ , _gtrsReturnSize :: !Int+ , _gtrsTotalSize :: !Int+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GetTagsResponse' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gtrsNextPageToken' - The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+--+-- * 'gtrsResponseStatus' - -- | The response status code.+--+-- * 'gtrsTags' - The tags that match your request.+--+-- * 'gtrsReturnSize' - The number of query results that AWS returns at a time.+--+-- * 'gtrsTotalSize' - The total number of query results.+getTagsResponse+ :: Int -- ^ 'gtrsResponseStatus'+ -> Int -- ^ 'gtrsReturnSize'+ -> Int -- ^ 'gtrsTotalSize'+ -> GetTagsResponse+getTagsResponse pResponseStatus_ pReturnSize_ pTotalSize_ =+ GetTagsResponse'+ { _gtrsNextPageToken = Nothing+ , _gtrsResponseStatus = pResponseStatus_+ , _gtrsTags = mempty+ , _gtrsReturnSize = pReturnSize_+ , _gtrsTotalSize = pTotalSize_+ }+++-- | The token for the next set of retrievable results. AWS provides the token when the response from a previous call has more results than the maximum page size.+gtrsNextPageToken :: Lens' GetTagsResponse (Maybe Text)+gtrsNextPageToken = lens _gtrsNextPageToken (\ s a -> s{_gtrsNextPageToken = a})++-- | -- | The response status code.+gtrsResponseStatus :: Lens' GetTagsResponse Int+gtrsResponseStatus = lens _gtrsResponseStatus (\ s a -> s{_gtrsResponseStatus = a})++-- | The tags that match your request.+gtrsTags :: Lens' GetTagsResponse [Text]+gtrsTags = lens _gtrsTags (\ s a -> s{_gtrsTags = a}) . _Coerce++-- | The number of query results that AWS returns at a time.+gtrsReturnSize :: Lens' GetTagsResponse Int+gtrsReturnSize = lens _gtrsReturnSize (\ s a -> s{_gtrsReturnSize = a})++-- | The total number of query results.+gtrsTotalSize :: Lens' GetTagsResponse Int+gtrsTotalSize = lens _gtrsTotalSize (\ s a -> s{_gtrsTotalSize = a})++instance NFData GetTagsResponse where
+ gen/Network/AWS/CostExplorer/Types.hs view
@@ -0,0 +1,330 @@+{-# LANGUAGE OverloadedStrings #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.Types+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.CostExplorer.Types+ (+ -- * Service Configuration+ costExplorer++ -- * Errors+ , _BillExpirationException+ , _RequestChangedException+ , _InvalidNextTokenException+ , _DataUnavailableException+ , _LimitExceededException++ -- * AccountScope+ , AccountScope (..)++ -- * Context+ , Context (..)++ -- * Dimension+ , Dimension (..)++ -- * Granularity+ , Granularity (..)++ -- * GroupDefinitionType+ , GroupDefinitionType (..)++ -- * LookbackPeriodInDays+ , LookbackPeriodInDays (..)++ -- * OfferingClass+ , OfferingClass (..)++ -- * PaymentOption+ , PaymentOption (..)++ -- * TermInYears+ , TermInYears (..)++ -- * Coverage+ , Coverage+ , coverage+ , cCoverageHours++ -- * CoverageByTime+ , CoverageByTime+ , coverageByTime+ , cbtGroups+ , cbtTimePeriod+ , cbtTotal++ -- * CoverageHours+ , CoverageHours+ , coverageHours+ , chCoverageHoursPercentage+ , chOnDemandHours+ , chTotalRunningHours+ , chReservedHours++ -- * DateInterval+ , DateInterval+ , dateInterval+ , diStart+ , diEnd++ -- * DimensionValues+ , DimensionValues+ , dimensionValues+ , dvValues+ , dvKey++ -- * DimensionValuesWithAttributes+ , DimensionValuesWithAttributes+ , dimensionValuesWithAttributes+ , dvwaValue+ , dvwaAttributes++ -- * EC2InstanceDetails+ , EC2InstanceDetails+ , ec2InstanceDetails+ , eidCurrentGeneration+ , eidPlatform+ , eidFamily+ , eidInstanceType+ , eidAvailabilityZone+ , eidSizeFlexEligible+ , eidTenancy+ , eidRegion++ -- * EC2Specification+ , EC2Specification+ , ec2Specification+ , esOfferingClass++ -- * Expression+ , Expression+ , expression+ , eNot+ , eAnd+ , eOr+ , eDimensions+ , eTags++ -- * Group+ , Group+ , group'+ , gMetrics+ , gKeys++ -- * GroupDefinition+ , GroupDefinition+ , groupDefinition+ , gdKey+ , gdType++ -- * InstanceDetails+ , InstanceDetails+ , instanceDetails+ , idRDSInstanceDetails+ , idEC2InstanceDetails++ -- * MetricValue+ , MetricValue+ , metricValue+ , mvAmount+ , mvUnit++ -- * RDSInstanceDetails+ , RDSInstanceDetails+ , rdsInstanceDetails+ , ridCurrentGeneration+ , ridDeploymentOption+ , ridFamily+ , ridInstanceType+ , ridLicenseModel+ , ridSizeFlexEligible+ , ridRegion+ , ridDatabaseEngine++ -- * ReservationAggregates+ , ReservationAggregates+ , reservationAggregates+ , raPurchasedHours+ , raTotalActualHours+ , raUtilizationPercentage+ , raUnusedHours++ -- * ReservationCoverageGroup+ , ReservationCoverageGroup+ , reservationCoverageGroup+ , rcgCoverage+ , rcgAttributes++ -- * ReservationPurchaseRecommendation+ , ReservationPurchaseRecommendation+ , reservationPurchaseRecommendation+ , rprTermInYears+ , rprRecommendationSummary+ , rprServiceSpecification+ , rprAccountScope+ , rprRecommendationDetails+ , rprLookbackPeriodInDays+ , rprPaymentOption++ -- * ReservationPurchaseRecommendationDetail+ , ReservationPurchaseRecommendationDetail+ , reservationPurchaseRecommendationDetail+ , rprdMaximumNormalizedUnitsUsedPerHour+ , rprdRecurringStandardMonthlyCost+ , rprdAverageNormalizedUnitsUsedPerHour+ , rprdCurrencyCode+ , rprdEstimatedMonthlySavingsPercentage+ , rprdRecommendedNormalizedUnitsToPurchase+ , rprdAverageUtilization+ , rprdEstimatedMonthlySavingsAmount+ , rprdUpfrontCost+ , rprdMinimumNormalizedUnitsUsedPerHour+ , rprdEstimatedMonthlyOnDemandCost+ , rprdRecommendedNumberOfInstancesToPurchase+ , rprdMaximumNumberOfInstancesUsedPerHour+ , rprdEstimatedReservationCostForLookbackPeriod+ , rprdInstanceDetails+ , rprdAverageNumberOfInstancesUsedPerHour+ , rprdMinimumNumberOfInstancesUsedPerHour+ , rprdEstimatedBreakEvenInMonths++ -- * ReservationPurchaseRecommendationMetadata+ , ReservationPurchaseRecommendationMetadata+ , reservationPurchaseRecommendationMetadata+ , rprmRecommendationId+ , rprmGenerationTimestamp++ -- * ReservationPurchaseRecommendationSummary+ , ReservationPurchaseRecommendationSummary+ , reservationPurchaseRecommendationSummary+ , rprsCurrencyCode+ , rprsTotalEstimatedMonthlySavingsPercentage+ , rprsTotalEstimatedMonthlySavingsAmount++ -- * ReservationUtilizationGroup+ , ReservationUtilizationGroup+ , reservationUtilizationGroup+ , rugValue+ , rugKey+ , rugAttributes+ , rugUtilization++ -- * ResultByTime+ , ResultByTime+ , resultByTime+ , rbtGroups+ , rbtTimePeriod+ , rbtTotal+ , rbtEstimated++ -- * ServiceSpecification+ , ServiceSpecification+ , serviceSpecification+ , ssEC2Specification++ -- * TagValues+ , TagValues+ , tagValues+ , tvValues+ , tvKey++ -- * UtilizationByTime+ , UtilizationByTime+ , utilizationByTime+ , ubtGroups+ , ubtTimePeriod+ , ubtTotal+ ) where++import Network.AWS.CostExplorer.Types.Product+import Network.AWS.CostExplorer.Types.Sum+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Sign.V4++-- | API version @2017-10-25@ of the Amazon Cost Explorer Service SDK configuration.+costExplorer :: Service+costExplorer =+ Service+ { _svcAbbrev = "CostExplorer"+ , _svcSigner = v4+ , _svcPrefix = "ce"+ , _svcVersion = "2017-10-25"+ , _svcEndpoint = defaultEndpoint costExplorer+ , _svcTimeout = Just 70+ , _svcCheck = statusSuccess+ , _svcError = parseJSONError "CostExplorer"+ , _svcRetry = retry+ }+ where+ retry =+ Exponential+ { _retryBase = 5.0e-2+ , _retryGrowth = 2+ , _retryAttempts = 5+ , _retryCheck = check+ }+ check e+ | has (hasCode "ThrottledException" . hasStatus 400) e =+ Just "throttled_exception"+ | has (hasStatus 429) e = Just "too_many_requests"+ | has (hasCode "ThrottlingException" . hasStatus 400) e =+ Just "throttling_exception"+ | has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"+ | has (hasStatus 504) e = Just "gateway_timeout"+ | has (hasCode "RequestThrottledException" . hasStatus 400) e =+ Just "request_throttled_exception"+ | has (hasStatus 502) e = Just "bad_gateway"+ | has (hasStatus 503) e = Just "service_unavailable"+ | has (hasStatus 500) e = Just "general_server_error"+ | has (hasStatus 509) e = Just "limit_exceeded"+ | otherwise = Nothing+++-- | The requested report expired. Update the date interval and try again.+--+--+_BillExpirationException :: AsError a => Getting (First ServiceError) a ServiceError+_BillExpirationException =+ _MatchServiceError costExplorer "BillExpirationException"+++-- | Your request parameters changed between pages. Try again with the old parameters or without a pagination token.+--+--+_RequestChangedException :: AsError a => Getting (First ServiceError) a ServiceError+_RequestChangedException =+ _MatchServiceError costExplorer "RequestChangedException"+++-- | The pagination token is invalid. Try again without a pagination token.+--+--+_InvalidNextTokenException :: AsError a => Getting (First ServiceError) a ServiceError+_InvalidNextTokenException =+ _MatchServiceError costExplorer "InvalidNextTokenException"+++-- | The requested data is unavailable.+--+--+_DataUnavailableException :: AsError a => Getting (First ServiceError) a ServiceError+_DataUnavailableException =+ _MatchServiceError costExplorer "DataUnavailableException"+++-- | You made too many calls in a short period of time. Try again later.+--+--+_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError+_LimitExceededException =+ _MatchServiceError costExplorer "LimitExceededException"+
+ gen/Network/AWS/CostExplorer/Types/Product.hs view
@@ -0,0 +1,1589 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.Types.Product+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.CostExplorer.Types.Product where++import Network.AWS.CostExplorer.Types.Sum+import Network.AWS.Lens+import Network.AWS.Prelude++-- | The amount of instance usage that a reservation covered.+--+--+--+-- /See:/ 'coverage' smart constructor.+newtype Coverage = Coverage'+ { _cCoverageHours :: Maybe CoverageHours+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'Coverage' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cCoverageHours' - The amount of instance usage that a reservation covered, in hours.+coverage+ :: Coverage+coverage = Coverage' {_cCoverageHours = Nothing}+++-- | The amount of instance usage that a reservation covered, in hours.+cCoverageHours :: Lens' Coverage (Maybe CoverageHours)+cCoverageHours = lens _cCoverageHours (\ s a -> s{_cCoverageHours = a})++instance FromJSON Coverage where+ parseJSON+ = withObject "Coverage"+ (\ x -> Coverage' <$> (x .:? "CoverageHours"))++instance Hashable Coverage where++instance NFData Coverage where++-- | Reservation coverage for a specified period, in hours.+--+--+--+-- /See:/ 'coverageByTime' smart constructor.+data CoverageByTime = CoverageByTime'+ { _cbtGroups :: !(Maybe [ReservationCoverageGroup])+ , _cbtTimePeriod :: !(Maybe DateInterval)+ , _cbtTotal :: !(Maybe Coverage)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'CoverageByTime' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'cbtGroups' - The groups of instances that are covered by a reservation.+--+-- * 'cbtTimePeriod' - The period over which this coverage was used.+--+-- * 'cbtTotal' - The total reservation coverage, in hours.+coverageByTime+ :: CoverageByTime+coverageByTime =+ CoverageByTime'+ {_cbtGroups = Nothing, _cbtTimePeriod = Nothing, _cbtTotal = Nothing}+++-- | The groups of instances that are covered by a reservation.+cbtGroups :: Lens' CoverageByTime [ReservationCoverageGroup]+cbtGroups = lens _cbtGroups (\ s a -> s{_cbtGroups = a}) . _Default . _Coerce++-- | The period over which this coverage was used.+cbtTimePeriod :: Lens' CoverageByTime (Maybe DateInterval)+cbtTimePeriod = lens _cbtTimePeriod (\ s a -> s{_cbtTimePeriod = a})++-- | The total reservation coverage, in hours.+cbtTotal :: Lens' CoverageByTime (Maybe Coverage)+cbtTotal = lens _cbtTotal (\ s a -> s{_cbtTotal = a})++instance FromJSON CoverageByTime where+ parseJSON+ = withObject "CoverageByTime"+ (\ x ->+ CoverageByTime' <$>+ (x .:? "Groups" .!= mempty) <*> (x .:? "TimePeriod")+ <*> (x .:? "Total"))++instance Hashable CoverageByTime where++instance NFData CoverageByTime where++-- | How long a running instance either used a reservation or was On-Demand.+--+--+--+-- /See:/ 'coverageHours' smart constructor.+data CoverageHours = CoverageHours'+ { _chCoverageHoursPercentage :: !(Maybe Text)+ , _chOnDemandHours :: !(Maybe Text)+ , _chTotalRunningHours :: !(Maybe Text)+ , _chReservedHours :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'CoverageHours' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'chCoverageHoursPercentage' - The percentage of instance hours that are covered by a reservation.+--+-- * 'chOnDemandHours' - The number of instance running hours that are covered by On-Demand Instances.+--+-- * 'chTotalRunningHours' - The total instance usage, in hours.+--+-- * 'chReservedHours' - The number of instance running hours that are covered by reservations.+coverageHours+ :: CoverageHours+coverageHours =+ CoverageHours'+ { _chCoverageHoursPercentage = Nothing+ , _chOnDemandHours = Nothing+ , _chTotalRunningHours = Nothing+ , _chReservedHours = Nothing+ }+++-- | The percentage of instance hours that are covered by a reservation.+chCoverageHoursPercentage :: Lens' CoverageHours (Maybe Text)+chCoverageHoursPercentage = lens _chCoverageHoursPercentage (\ s a -> s{_chCoverageHoursPercentage = a})++-- | The number of instance running hours that are covered by On-Demand Instances.+chOnDemandHours :: Lens' CoverageHours (Maybe Text)+chOnDemandHours = lens _chOnDemandHours (\ s a -> s{_chOnDemandHours = a})++-- | The total instance usage, in hours.+chTotalRunningHours :: Lens' CoverageHours (Maybe Text)+chTotalRunningHours = lens _chTotalRunningHours (\ s a -> s{_chTotalRunningHours = a})++-- | The number of instance running hours that are covered by reservations.+chReservedHours :: Lens' CoverageHours (Maybe Text)+chReservedHours = lens _chReservedHours (\ s a -> s{_chReservedHours = a})++instance FromJSON CoverageHours where+ parseJSON+ = withObject "CoverageHours"+ (\ x ->+ CoverageHours' <$>+ (x .:? "CoverageHoursPercentage") <*>+ (x .:? "OnDemandHours")+ <*> (x .:? "TotalRunningHours")+ <*> (x .:? "ReservedHours"))++instance Hashable CoverageHours where++instance NFData CoverageHours where++-- | The time period that you want the usage and costs for.+--+--+--+-- /See:/ 'dateInterval' smart constructor.+data DateInterval = DateInterval'+ { _diStart :: !Text+ , _diEnd :: !Text+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'DateInterval' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'diStart' - The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if @start@ is @2017-01-01@ , AWS retrieves cost and usage data starting at @2017-01-01@ up to the end date.+--+-- * 'diEnd' - The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if @end@ is @2017-05-01@ , AWS retrieves cost and usage data from the start date up to, but not including, @2017-05-01@ .+dateInterval+ :: Text -- ^ 'diStart'+ -> Text -- ^ 'diEnd'+ -> DateInterval+dateInterval pStart_ pEnd_ = DateInterval' {_diStart = pStart_, _diEnd = pEnd_}+++-- | The beginning of the time period that you want the usage and costs for. The start date is inclusive. For example, if @start@ is @2017-01-01@ , AWS retrieves cost and usage data starting at @2017-01-01@ up to the end date.+diStart :: Lens' DateInterval Text+diStart = lens _diStart (\ s a -> s{_diStart = a})++-- | The end of the time period that you want the usage and costs for. The end date is exclusive. For example, if @end@ is @2017-05-01@ , AWS retrieves cost and usage data from the start date up to, but not including, @2017-05-01@ .+diEnd :: Lens' DateInterval Text+diEnd = lens _diEnd (\ s a -> s{_diEnd = a})++instance FromJSON DateInterval where+ parseJSON+ = withObject "DateInterval"+ (\ x ->+ DateInterval' <$> (x .: "Start") <*> (x .: "End"))++instance Hashable DateInterval where++instance NFData DateInterval where++instance ToJSON DateInterval where+ toJSON DateInterval'{..}+ = object+ (catMaybes+ [Just ("Start" .= _diStart), Just ("End" .= _diEnd)])++-- | The metadata that you can use to filter and group your results. You can use @GetDimensionValues@ to find specific values.+--+--+--+-- /See:/ 'dimensionValues' smart constructor.+data DimensionValues = DimensionValues'+ { _dvValues :: !(Maybe [Text])+ , _dvKey :: !(Maybe Dimension)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'DimensionValues' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dvValues' - The metadata values that you can use to filter and group your results. You can use @GetDimensionValues@ to find specific values.+--+-- * 'dvKey' - The names of the metadata types that you can use to filter and group your results. For example, @AZ@ returns a list of Availability Zones.+dimensionValues+ :: DimensionValues+dimensionValues = DimensionValues' {_dvValues = Nothing, _dvKey = Nothing}+++-- | The metadata values that you can use to filter and group your results. You can use @GetDimensionValues@ to find specific values.+dvValues :: Lens' DimensionValues [Text]+dvValues = lens _dvValues (\ s a -> s{_dvValues = a}) . _Default . _Coerce++-- | The names of the metadata types that you can use to filter and group your results. For example, @AZ@ returns a list of Availability Zones.+dvKey :: Lens' DimensionValues (Maybe Dimension)+dvKey = lens _dvKey (\ s a -> s{_dvKey = a})++instance Hashable DimensionValues where++instance NFData DimensionValues where++instance ToJSON DimensionValues where+ toJSON DimensionValues'{..}+ = object+ (catMaybes+ [("Values" .=) <$> _dvValues, ("Key" .=) <$> _dvKey])++-- | The metadata of a specific type that you can use to filter and group your results. You can use @GetDimensionValues@ to find specific values.+--+--+--+-- /See:/ 'dimensionValuesWithAttributes' smart constructor.+data DimensionValuesWithAttributes = DimensionValuesWithAttributes'+ { _dvwaValue :: !(Maybe Text)+ , _dvwaAttributes :: !(Maybe (Map Text Text))+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'DimensionValuesWithAttributes' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'dvwaValue' - The value of a dimension with a specific attribute.+--+-- * 'dvwaAttributes' - The attribute that applies to a specific @Dimension@ .+dimensionValuesWithAttributes+ :: DimensionValuesWithAttributes+dimensionValuesWithAttributes =+ DimensionValuesWithAttributes'+ {_dvwaValue = Nothing, _dvwaAttributes = Nothing}+++-- | The value of a dimension with a specific attribute.+dvwaValue :: Lens' DimensionValuesWithAttributes (Maybe Text)+dvwaValue = lens _dvwaValue (\ s a -> s{_dvwaValue = a})++-- | The attribute that applies to a specific @Dimension@ .+dvwaAttributes :: Lens' DimensionValuesWithAttributes (HashMap Text Text)+dvwaAttributes = lens _dvwaAttributes (\ s a -> s{_dvwaAttributes = a}) . _Default . _Map++instance FromJSON DimensionValuesWithAttributes where+ parseJSON+ = withObject "DimensionValuesWithAttributes"+ (\ x ->+ DimensionValuesWithAttributes' <$>+ (x .:? "Value") <*> (x .:? "Attributes" .!= mempty))++instance Hashable DimensionValuesWithAttributes where++instance NFData DimensionValuesWithAttributes where++-- | Details about the EC2 instances that AWS recommends that you purchase.+--+--+--+-- /See:/ 'ec2InstanceDetails' smart constructor.+data EC2InstanceDetails = EC2InstanceDetails'+ { _eidCurrentGeneration :: !(Maybe Bool)+ , _eidPlatform :: !(Maybe Text)+ , _eidFamily :: !(Maybe Text)+ , _eidInstanceType :: !(Maybe Text)+ , _eidAvailabilityZone :: !(Maybe Text)+ , _eidSizeFlexEligible :: !(Maybe Bool)+ , _eidTenancy :: !(Maybe Text)+ , _eidRegion :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'EC2InstanceDetails' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eidCurrentGeneration' - Whether the recommendation is for a current generation instance.+--+-- * 'eidPlatform' - The platform of the recommended reservation. The platform is the specific combination of operating system, license model, and software on an instance.+--+-- * 'eidFamily' - The instance family of the recommended reservation.+--+-- * 'eidInstanceType' - The type of instance that AWS recommends.+--+-- * 'eidAvailabilityZone' - The Availability Zone of the recommended reservation.+--+-- * 'eidSizeFlexEligible' - Whether the recommended reservation is size flexible.+--+-- * 'eidTenancy' - Whether the recommended reservation is dedicated or shared.+--+-- * 'eidRegion' - The AWS Region of the recommended reservation.+ec2InstanceDetails+ :: EC2InstanceDetails+ec2InstanceDetails =+ EC2InstanceDetails'+ { _eidCurrentGeneration = Nothing+ , _eidPlatform = Nothing+ , _eidFamily = Nothing+ , _eidInstanceType = Nothing+ , _eidAvailabilityZone = Nothing+ , _eidSizeFlexEligible = Nothing+ , _eidTenancy = Nothing+ , _eidRegion = Nothing+ }+++-- | Whether the recommendation is for a current generation instance.+eidCurrentGeneration :: Lens' EC2InstanceDetails (Maybe Bool)+eidCurrentGeneration = lens _eidCurrentGeneration (\ s a -> s{_eidCurrentGeneration = a})++-- | The platform of the recommended reservation. The platform is the specific combination of operating system, license model, and software on an instance.+eidPlatform :: Lens' EC2InstanceDetails (Maybe Text)+eidPlatform = lens _eidPlatform (\ s a -> s{_eidPlatform = a})++-- | The instance family of the recommended reservation.+eidFamily :: Lens' EC2InstanceDetails (Maybe Text)+eidFamily = lens _eidFamily (\ s a -> s{_eidFamily = a})++-- | The type of instance that AWS recommends.+eidInstanceType :: Lens' EC2InstanceDetails (Maybe Text)+eidInstanceType = lens _eidInstanceType (\ s a -> s{_eidInstanceType = a})++-- | The Availability Zone of the recommended reservation.+eidAvailabilityZone :: Lens' EC2InstanceDetails (Maybe Text)+eidAvailabilityZone = lens _eidAvailabilityZone (\ s a -> s{_eidAvailabilityZone = a})++-- | Whether the recommended reservation is size flexible.+eidSizeFlexEligible :: Lens' EC2InstanceDetails (Maybe Bool)+eidSizeFlexEligible = lens _eidSizeFlexEligible (\ s a -> s{_eidSizeFlexEligible = a})++-- | Whether the recommended reservation is dedicated or shared.+eidTenancy :: Lens' EC2InstanceDetails (Maybe Text)+eidTenancy = lens _eidTenancy (\ s a -> s{_eidTenancy = a})++-- | The AWS Region of the recommended reservation.+eidRegion :: Lens' EC2InstanceDetails (Maybe Text)+eidRegion = lens _eidRegion (\ s a -> s{_eidRegion = a})++instance FromJSON EC2InstanceDetails where+ parseJSON+ = withObject "EC2InstanceDetails"+ (\ x ->+ EC2InstanceDetails' <$>+ (x .:? "CurrentGeneration") <*> (x .:? "Platform")+ <*> (x .:? "Family")+ <*> (x .:? "InstanceType")+ <*> (x .:? "AvailabilityZone")+ <*> (x .:? "SizeFlexEligible")+ <*> (x .:? "Tenancy")+ <*> (x .:? "Region"))++instance Hashable EC2InstanceDetails where++instance NFData EC2InstanceDetails where++-- | The EC2 hardware specifications that you want AWS to provide recommendations for.+--+--+--+-- /See:/ 'ec2Specification' smart constructor.+newtype EC2Specification = EC2Specification'+ { _esOfferingClass :: Maybe OfferingClass+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'EC2Specification' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'esOfferingClass' - Whether you want a recommendation for standard or convertible reservations.+ec2Specification+ :: EC2Specification+ec2Specification = EC2Specification' {_esOfferingClass = Nothing}+++-- | Whether you want a recommendation for standard or convertible reservations.+esOfferingClass :: Lens' EC2Specification (Maybe OfferingClass)+esOfferingClass = lens _esOfferingClass (\ s a -> s{_esOfferingClass = a})++instance FromJSON EC2Specification where+ parseJSON+ = withObject "EC2Specification"+ (\ x ->+ EC2Specification' <$> (x .:? "OfferingClass"))++instance Hashable EC2Specification where++instance NFData EC2Specification where++instance ToJSON EC2Specification where+ toJSON EC2Specification'{..}+ = object+ (catMaybes+ [("OfferingClass" .=) <$> _esOfferingClass])++-- | Use @Expression@ to filter by cost or by usage. There are two patterns:+--+--+-- * Simple dimension values - You can set the dimension name and values for the filters that you plan to use. For example, you can filter for @INSTANCE_TYPE==m4.xlarge OR INSTANCE_TYPE==c4.large@ . The @Expression@ for that looks like this:+--+-- @{ "Dimensions": { "Key": "INSTANCE_TYPE", "Values": [ "m4.xlarge", “c4.large” ] } }@+--+-- The list of dimension values are OR'd together to retrieve cost or usage data. You can create @Expression@ and @DimensionValues@ objects using either @with*@ methods or @set*@ methods in multiple lines.+--+-- * Compound dimension values with logical operations - You can use multiple @Expression@ types and the logical operators @AND/OR/NOT@ to create a list of one or more @Expression@ objects. This allows you to filter on more advanced options. For example, you can filter on @((INSTANCE_TYPE == m4.large OR INSTANCE_TYPE == m3.large) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)@ . The @Expression@ for that looks like this:+--+-- @{ "And": [ {"Or": [ {"Dimensions": { "Key": "INSTANCE_TYPE", "Values": [ "m4.x.large", "c4.large" ] }}, {"Tag": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } @+--+-- @{ "And": [ ... ], "DimensionValues": { "Dimension": "USAGE_TYPE", "Values": [ "DataTransfer" ] } } @+--+--+--+--+-- /See:/ 'expression' smart constructor.+data Expression = Expression'+ { _eNot :: !(Maybe Expression)+ , _eAnd :: !(Maybe [Expression])+ , _eOr :: !(Maybe [Expression])+ , _eDimensions :: !(Maybe DimensionValues)+ , _eTags :: !(Maybe TagValues)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'Expression' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'eNot' - Return results that don't match a @Dimension@ object.+--+-- * 'eAnd' - Return results that match both @Dimension@ objects.+--+-- * 'eOr' - Return results that match either @Dimension@ object.+--+-- * 'eDimensions' - The specific @Dimension@ to use for @Expression@ .+--+-- * 'eTags' - The specific @Tag@ to use for @Expression@ .+expression+ :: Expression+expression =+ Expression'+ { _eNot = Nothing+ , _eAnd = Nothing+ , _eOr = Nothing+ , _eDimensions = Nothing+ , _eTags = Nothing+ }+++-- | Return results that don't match a @Dimension@ object.+eNot :: Lens' Expression (Maybe Expression)+eNot = lens _eNot (\ s a -> s{_eNot = a})++-- | Return results that match both @Dimension@ objects.+eAnd :: Lens' Expression [Expression]+eAnd = lens _eAnd (\ s a -> s{_eAnd = a}) . _Default . _Coerce++-- | Return results that match either @Dimension@ object.+eOr :: Lens' Expression [Expression]+eOr = lens _eOr (\ s a -> s{_eOr = a}) . _Default . _Coerce++-- | The specific @Dimension@ to use for @Expression@ .+eDimensions :: Lens' Expression (Maybe DimensionValues)+eDimensions = lens _eDimensions (\ s a -> s{_eDimensions = a})++-- | The specific @Tag@ to use for @Expression@ .+eTags :: Lens' Expression (Maybe TagValues)+eTags = lens _eTags (\ s a -> s{_eTags = a})++instance Hashable Expression where++instance NFData Expression where++instance ToJSON Expression where+ toJSON Expression'{..}+ = object+ (catMaybes+ [("Not" .=) <$> _eNot, ("And" .=) <$> _eAnd,+ ("Or" .=) <$> _eOr,+ ("Dimensions" .=) <$> _eDimensions,+ ("Tags" .=) <$> _eTags])++-- | One level of grouped data within the results.+--+--+--+-- /See:/ 'group'' smart constructor.+data Group = Group'+ { _gMetrics :: !(Maybe (Map Text MetricValue))+ , _gKeys :: !(Maybe [Text])+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'Group' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gMetrics' - The metrics that are included in this group.+--+-- * 'gKeys' - The keys that are included in this group.+group'+ :: Group+group' = Group' {_gMetrics = Nothing, _gKeys = Nothing}+++-- | The metrics that are included in this group.+gMetrics :: Lens' Group (HashMap Text MetricValue)+gMetrics = lens _gMetrics (\ s a -> s{_gMetrics = a}) . _Default . _Map++-- | The keys that are included in this group.+gKeys :: Lens' Group [Text]+gKeys = lens _gKeys (\ s a -> s{_gKeys = a}) . _Default . _Coerce++instance FromJSON Group where+ parseJSON+ = withObject "Group"+ (\ x ->+ Group' <$>+ (x .:? "Metrics" .!= mempty) <*>+ (x .:? "Keys" .!= mempty))++instance Hashable Group where++instance NFData Group where++-- | Represents a group when you specify a group by criteria, or in the response to a query with a specific grouping.+--+--+--+-- /See:/ 'groupDefinition' smart constructor.+data GroupDefinition = GroupDefinition'+ { _gdKey :: !(Maybe Text)+ , _gdType :: !(Maybe GroupDefinitionType)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'GroupDefinition' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'gdKey' - The string that represents a key for a specified group.+--+-- * 'gdType' - The string that represents the type of group.+groupDefinition+ :: GroupDefinition+groupDefinition = GroupDefinition' {_gdKey = Nothing, _gdType = Nothing}+++-- | The string that represents a key for a specified group.+gdKey :: Lens' GroupDefinition (Maybe Text)+gdKey = lens _gdKey (\ s a -> s{_gdKey = a})++-- | The string that represents the type of group.+gdType :: Lens' GroupDefinition (Maybe GroupDefinitionType)+gdType = lens _gdType (\ s a -> s{_gdType = a})++instance FromJSON GroupDefinition where+ parseJSON+ = withObject "GroupDefinition"+ (\ x ->+ GroupDefinition' <$>+ (x .:? "Key") <*> (x .:? "Type"))++instance Hashable GroupDefinition where++instance NFData GroupDefinition where++instance ToJSON GroupDefinition where+ toJSON GroupDefinition'{..}+ = object+ (catMaybes+ [("Key" .=) <$> _gdKey, ("Type" .=) <$> _gdType])++-- | Details about the instances that AWS recommends that you purchase.+--+--+--+-- /See:/ 'instanceDetails' smart constructor.+data InstanceDetails = InstanceDetails'+ { _idRDSInstanceDetails :: !(Maybe RDSInstanceDetails)+ , _idEC2InstanceDetails :: !(Maybe EC2InstanceDetails)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'InstanceDetails' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'idRDSInstanceDetails' - The RDS instances that AWS recommends that you purchase.+--+-- * 'idEC2InstanceDetails' - The EC2 instances that AWS recommends that you purchase.+instanceDetails+ :: InstanceDetails+instanceDetails =+ InstanceDetails'+ {_idRDSInstanceDetails = Nothing, _idEC2InstanceDetails = Nothing}+++-- | The RDS instances that AWS recommends that you purchase.+idRDSInstanceDetails :: Lens' InstanceDetails (Maybe RDSInstanceDetails)+idRDSInstanceDetails = lens _idRDSInstanceDetails (\ s a -> s{_idRDSInstanceDetails = a})++-- | The EC2 instances that AWS recommends that you purchase.+idEC2InstanceDetails :: Lens' InstanceDetails (Maybe EC2InstanceDetails)+idEC2InstanceDetails = lens _idEC2InstanceDetails (\ s a -> s{_idEC2InstanceDetails = a})++instance FromJSON InstanceDetails where+ parseJSON+ = withObject "InstanceDetails"+ (\ x ->+ InstanceDetails' <$>+ (x .:? "RDSInstanceDetails") <*>+ (x .:? "EC2InstanceDetails"))++instance Hashable InstanceDetails where++instance NFData InstanceDetails where++-- | The aggregated value for a metric.+--+--+--+-- /See:/ 'metricValue' smart constructor.+data MetricValue = MetricValue'+ { _mvAmount :: !(Maybe Text)+ , _mvUnit :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'MetricValue' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'mvAmount' - The actual number that represents the metric.+--+-- * 'mvUnit' - The unit that the metric is given in.+metricValue+ :: MetricValue+metricValue = MetricValue' {_mvAmount = Nothing, _mvUnit = Nothing}+++-- | The actual number that represents the metric.+mvAmount :: Lens' MetricValue (Maybe Text)+mvAmount = lens _mvAmount (\ s a -> s{_mvAmount = a})++-- | The unit that the metric is given in.+mvUnit :: Lens' MetricValue (Maybe Text)+mvUnit = lens _mvUnit (\ s a -> s{_mvUnit = a})++instance FromJSON MetricValue where+ parseJSON+ = withObject "MetricValue"+ (\ x ->+ MetricValue' <$> (x .:? "Amount") <*> (x .:? "Unit"))++instance Hashable MetricValue where++instance NFData MetricValue where++-- | Details about the RDS instances that AWS recommends that you purchase.+--+--+--+-- /See:/ 'rdsInstanceDetails' smart constructor.+data RDSInstanceDetails = RDSInstanceDetails'+ { _ridCurrentGeneration :: !(Maybe Bool)+ , _ridDeploymentOption :: !(Maybe Text)+ , _ridFamily :: !(Maybe Text)+ , _ridInstanceType :: !(Maybe Text)+ , _ridLicenseModel :: !(Maybe Text)+ , _ridSizeFlexEligible :: !(Maybe Bool)+ , _ridRegion :: !(Maybe Text)+ , _ridDatabaseEngine :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'RDSInstanceDetails' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ridCurrentGeneration' - Whether the recommendation is for a current generation instance.+--+-- * 'ridDeploymentOption' - Whether the recommendation is for a reservation in a single availability zone or a reservation with a backup in a second availability zone.+--+-- * 'ridFamily' - The instance family of the recommended reservation.+--+-- * 'ridInstanceType' - The type of instance that AWS recommends.+--+-- * 'ridLicenseModel' - The license model that the recommended reservation supports.+--+-- * 'ridSizeFlexEligible' - Whether the recommended reservation is size flexible.+--+-- * 'ridRegion' - The AWS Region of the recommended reservation.+--+-- * 'ridDatabaseEngine' - The database engine that the recommended reservation supports.+rdsInstanceDetails+ :: RDSInstanceDetails+rdsInstanceDetails =+ RDSInstanceDetails'+ { _ridCurrentGeneration = Nothing+ , _ridDeploymentOption = Nothing+ , _ridFamily = Nothing+ , _ridInstanceType = Nothing+ , _ridLicenseModel = Nothing+ , _ridSizeFlexEligible = Nothing+ , _ridRegion = Nothing+ , _ridDatabaseEngine = Nothing+ }+++-- | Whether the recommendation is for a current generation instance.+ridCurrentGeneration :: Lens' RDSInstanceDetails (Maybe Bool)+ridCurrentGeneration = lens _ridCurrentGeneration (\ s a -> s{_ridCurrentGeneration = a})++-- | Whether the recommendation is for a reservation in a single availability zone or a reservation with a backup in a second availability zone.+ridDeploymentOption :: Lens' RDSInstanceDetails (Maybe Text)+ridDeploymentOption = lens _ridDeploymentOption (\ s a -> s{_ridDeploymentOption = a})++-- | The instance family of the recommended reservation.+ridFamily :: Lens' RDSInstanceDetails (Maybe Text)+ridFamily = lens _ridFamily (\ s a -> s{_ridFamily = a})++-- | The type of instance that AWS recommends.+ridInstanceType :: Lens' RDSInstanceDetails (Maybe Text)+ridInstanceType = lens _ridInstanceType (\ s a -> s{_ridInstanceType = a})++-- | The license model that the recommended reservation supports.+ridLicenseModel :: Lens' RDSInstanceDetails (Maybe Text)+ridLicenseModel = lens _ridLicenseModel (\ s a -> s{_ridLicenseModel = a})++-- | Whether the recommended reservation is size flexible.+ridSizeFlexEligible :: Lens' RDSInstanceDetails (Maybe Bool)+ridSizeFlexEligible = lens _ridSizeFlexEligible (\ s a -> s{_ridSizeFlexEligible = a})++-- | The AWS Region of the recommended reservation.+ridRegion :: Lens' RDSInstanceDetails (Maybe Text)+ridRegion = lens _ridRegion (\ s a -> s{_ridRegion = a})++-- | The database engine that the recommended reservation supports.+ridDatabaseEngine :: Lens' RDSInstanceDetails (Maybe Text)+ridDatabaseEngine = lens _ridDatabaseEngine (\ s a -> s{_ridDatabaseEngine = a})++instance FromJSON RDSInstanceDetails where+ parseJSON+ = withObject "RDSInstanceDetails"+ (\ x ->+ RDSInstanceDetails' <$>+ (x .:? "CurrentGeneration") <*>+ (x .:? "DeploymentOption")+ <*> (x .:? "Family")+ <*> (x .:? "InstanceType")+ <*> (x .:? "LicenseModel")+ <*> (x .:? "SizeFlexEligible")+ <*> (x .:? "Region")+ <*> (x .:? "DatabaseEngine"))++instance Hashable RDSInstanceDetails where++instance NFData RDSInstanceDetails where++-- | The aggregated numbers for your RI usage.+--+--+--+-- /See:/ 'reservationAggregates' smart constructor.+data ReservationAggregates = ReservationAggregates'+ { _raPurchasedHours :: !(Maybe Text)+ , _raTotalActualHours :: !(Maybe Text)+ , _raUtilizationPercentage :: !(Maybe Text)+ , _raUnusedHours :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationAggregates' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'raPurchasedHours' - How many RI hours that you purchased.+--+-- * 'raTotalActualHours' - The total number of RI hours that you used.+--+-- * 'raUtilizationPercentage' - The percentage of RI time that you used.+--+-- * 'raUnusedHours' - The number of RI hours that you didn't use.+reservationAggregates+ :: ReservationAggregates+reservationAggregates =+ ReservationAggregates'+ { _raPurchasedHours = Nothing+ , _raTotalActualHours = Nothing+ , _raUtilizationPercentage = Nothing+ , _raUnusedHours = Nothing+ }+++-- | How many RI hours that you purchased.+raPurchasedHours :: Lens' ReservationAggregates (Maybe Text)+raPurchasedHours = lens _raPurchasedHours (\ s a -> s{_raPurchasedHours = a})++-- | The total number of RI hours that you used.+raTotalActualHours :: Lens' ReservationAggregates (Maybe Text)+raTotalActualHours = lens _raTotalActualHours (\ s a -> s{_raTotalActualHours = a})++-- | The percentage of RI time that you used.+raUtilizationPercentage :: Lens' ReservationAggregates (Maybe Text)+raUtilizationPercentage = lens _raUtilizationPercentage (\ s a -> s{_raUtilizationPercentage = a})++-- | The number of RI hours that you didn't use.+raUnusedHours :: Lens' ReservationAggregates (Maybe Text)+raUnusedHours = lens _raUnusedHours (\ s a -> s{_raUnusedHours = a})++instance FromJSON ReservationAggregates where+ parseJSON+ = withObject "ReservationAggregates"+ (\ x ->+ ReservationAggregates' <$>+ (x .:? "PurchasedHours") <*>+ (x .:? "TotalActualHours")+ <*> (x .:? "UtilizationPercentage")+ <*> (x .:? "UnusedHours"))++instance Hashable ReservationAggregates where++instance NFData ReservationAggregates where++-- | A group of reservations that share a set of attributes.+--+--+--+-- /See:/ 'reservationCoverageGroup' smart constructor.+data ReservationCoverageGroup = ReservationCoverageGroup'+ { _rcgCoverage :: !(Maybe Coverage)+ , _rcgAttributes :: !(Maybe (Map Text Text))+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationCoverageGroup' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rcgCoverage' - How much instance usage this group of reservations covered.+--+-- * 'rcgAttributes' - The attributes for this group of reservations.+reservationCoverageGroup+ :: ReservationCoverageGroup+reservationCoverageGroup =+ ReservationCoverageGroup' {_rcgCoverage = Nothing, _rcgAttributes = Nothing}+++-- | How much instance usage this group of reservations covered.+rcgCoverage :: Lens' ReservationCoverageGroup (Maybe Coverage)+rcgCoverage = lens _rcgCoverage (\ s a -> s{_rcgCoverage = a})++-- | The attributes for this group of reservations.+rcgAttributes :: Lens' ReservationCoverageGroup (HashMap Text Text)+rcgAttributes = lens _rcgAttributes (\ s a -> s{_rcgAttributes = a}) . _Default . _Map++instance FromJSON ReservationCoverageGroup where+ parseJSON+ = withObject "ReservationCoverageGroup"+ (\ x ->+ ReservationCoverageGroup' <$>+ (x .:? "Coverage") <*>+ (x .:? "Attributes" .!= mempty))++instance Hashable ReservationCoverageGroup where++instance NFData ReservationCoverageGroup where++-- | A specific reservation that AWS recommends for purchase.+--+--+--+-- /See:/ 'reservationPurchaseRecommendation' smart constructor.+data ReservationPurchaseRecommendation = ReservationPurchaseRecommendation'+ { _rprTermInYears :: !(Maybe TermInYears)+ , _rprRecommendationSummary :: !(Maybe ReservationPurchaseRecommendationSummary)+ , _rprServiceSpecification :: !(Maybe ServiceSpecification)+ , _rprAccountScope :: !(Maybe AccountScope)+ , _rprRecommendationDetails :: !(Maybe [ReservationPurchaseRecommendationDetail])+ , _rprLookbackPeriodInDays :: !(Maybe LookbackPeriodInDays)+ , _rprPaymentOption :: !(Maybe PaymentOption)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationPurchaseRecommendation' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rprTermInYears' - The term of the reservation that you want recommendations for, in years.+--+-- * 'rprRecommendationSummary' - A summary about the recommended purchase.+--+-- * 'rprServiceSpecification' - Hardware specifications for the service that you want recommendations for.+--+-- * 'rprAccountScope' - The account scope that AWS recommends that you purchase this instance for. For example, you can purchase this reservation for an entire organization in AWS Organizations.+--+-- * 'rprRecommendationDetails' - Details about the recommended purchases.+--+-- * 'rprLookbackPeriodInDays' - How many days of previous usage that AWS takes into consideration when making this recommendation.+--+-- * 'rprPaymentOption' - The payment option for the reservation. For example, @AllUpfront@ or @NoUpfront@ .+reservationPurchaseRecommendation+ :: ReservationPurchaseRecommendation+reservationPurchaseRecommendation =+ ReservationPurchaseRecommendation'+ { _rprTermInYears = Nothing+ , _rprRecommendationSummary = Nothing+ , _rprServiceSpecification = Nothing+ , _rprAccountScope = Nothing+ , _rprRecommendationDetails = Nothing+ , _rprLookbackPeriodInDays = Nothing+ , _rprPaymentOption = Nothing+ }+++-- | The term of the reservation that you want recommendations for, in years.+rprTermInYears :: Lens' ReservationPurchaseRecommendation (Maybe TermInYears)+rprTermInYears = lens _rprTermInYears (\ s a -> s{_rprTermInYears = a})++-- | A summary about the recommended purchase.+rprRecommendationSummary :: Lens' ReservationPurchaseRecommendation (Maybe ReservationPurchaseRecommendationSummary)+rprRecommendationSummary = lens _rprRecommendationSummary (\ s a -> s{_rprRecommendationSummary = a})++-- | Hardware specifications for the service that you want recommendations for.+rprServiceSpecification :: Lens' ReservationPurchaseRecommendation (Maybe ServiceSpecification)+rprServiceSpecification = lens _rprServiceSpecification (\ s a -> s{_rprServiceSpecification = a})++-- | The account scope that AWS recommends that you purchase this instance for. For example, you can purchase this reservation for an entire organization in AWS Organizations.+rprAccountScope :: Lens' ReservationPurchaseRecommendation (Maybe AccountScope)+rprAccountScope = lens _rprAccountScope (\ s a -> s{_rprAccountScope = a})++-- | Details about the recommended purchases.+rprRecommendationDetails :: Lens' ReservationPurchaseRecommendation [ReservationPurchaseRecommendationDetail]+rprRecommendationDetails = lens _rprRecommendationDetails (\ s a -> s{_rprRecommendationDetails = a}) . _Default . _Coerce++-- | How many days of previous usage that AWS takes into consideration when making this recommendation.+rprLookbackPeriodInDays :: Lens' ReservationPurchaseRecommendation (Maybe LookbackPeriodInDays)+rprLookbackPeriodInDays = lens _rprLookbackPeriodInDays (\ s a -> s{_rprLookbackPeriodInDays = a})++-- | The payment option for the reservation. For example, @AllUpfront@ or @NoUpfront@ .+rprPaymentOption :: Lens' ReservationPurchaseRecommendation (Maybe PaymentOption)+rprPaymentOption = lens _rprPaymentOption (\ s a -> s{_rprPaymentOption = a})++instance FromJSON ReservationPurchaseRecommendation+ where+ parseJSON+ = withObject "ReservationPurchaseRecommendation"+ (\ x ->+ ReservationPurchaseRecommendation' <$>+ (x .:? "TermInYears") <*>+ (x .:? "RecommendationSummary")+ <*> (x .:? "ServiceSpecification")+ <*> (x .:? "AccountScope")+ <*> (x .:? "RecommendationDetails" .!= mempty)+ <*> (x .:? "LookbackPeriodInDays")+ <*> (x .:? "PaymentOption"))++instance Hashable ReservationPurchaseRecommendation+ where++instance NFData ReservationPurchaseRecommendation+ where++-- | Details about your recommended reservation purchase.+--+--+--+-- /See:/ 'reservationPurchaseRecommendationDetail' smart constructor.+data ReservationPurchaseRecommendationDetail = ReservationPurchaseRecommendationDetail'+ { _rprdMaximumNormalizedUnitsUsedPerHour :: !(Maybe Text)+ , _rprdRecurringStandardMonthlyCost :: !(Maybe Text)+ , _rprdAverageNormalizedUnitsUsedPerHour :: !(Maybe Text)+ , _rprdCurrencyCode :: !(Maybe Text)+ , _rprdEstimatedMonthlySavingsPercentage :: !(Maybe Text)+ , _rprdRecommendedNormalizedUnitsToPurchase :: !(Maybe Text)+ , _rprdAverageUtilization :: !(Maybe Text)+ , _rprdEstimatedMonthlySavingsAmount :: !(Maybe Text)+ , _rprdUpfrontCost :: !(Maybe Text)+ , _rprdMinimumNormalizedUnitsUsedPerHour :: !(Maybe Text)+ , _rprdEstimatedMonthlyOnDemandCost :: !(Maybe Text)+ , _rprdRecommendedNumberOfInstancesToPurchase :: !(Maybe Text)+ , _rprdMaximumNumberOfInstancesUsedPerHour :: !(Maybe Text)+ , _rprdEstimatedReservationCostForLookbackPeriod :: !(Maybe Text)+ , _rprdInstanceDetails :: !(Maybe InstanceDetails)+ , _rprdAverageNumberOfInstancesUsedPerHour :: !(Maybe Text)+ , _rprdMinimumNumberOfInstancesUsedPerHour :: !(Maybe Text)+ , _rprdEstimatedBreakEvenInMonths :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationPurchaseRecommendationDetail' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rprdMaximumNormalizedUnitsUsedPerHour' - The maximum number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdRecurringStandardMonthlyCost' - How much purchasing this instance costs you on a monthly basis.+--+-- * 'rprdAverageNormalizedUnitsUsedPerHour' - The average number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdCurrencyCode' - The currency code that AWS used to calculate the costs for this instance.+--+-- * 'rprdEstimatedMonthlySavingsPercentage' - How much AWS estimates that this specific recommendation could save you in a month, as a percentage of your overall costs.+--+-- * 'rprdRecommendedNormalizedUnitsToPurchase' - The number of normalized units that AWS recommends that you purchase.+--+-- * 'rprdAverageUtilization' - The average utilization of your instances. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdEstimatedMonthlySavingsAmount' - How much AWS estimates that this specific recommendation could save you in a month.+--+-- * 'rprdUpfrontCost' - How much purchasing this instance costs you upfront.+--+-- * 'rprdMinimumNormalizedUnitsUsedPerHour' - The minimum number of hours that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdEstimatedMonthlyOnDemandCost' - How much AWS estimates that you spend on On-Demand Instances in a month.+--+-- * 'rprdRecommendedNumberOfInstancesToPurchase' - The number of instances that AWS recommends that you purchase.+--+-- * 'rprdMaximumNumberOfInstancesUsedPerHour' - The maximum number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdEstimatedReservationCostForLookbackPeriod' - How much AWS estimates that you would have spent for all usage during the specified historical period if you had had a reservation.+--+-- * 'rprdInstanceDetails' - Details about the instances that AWS recommends that you purchase.+--+-- * 'rprdAverageNumberOfInstancesUsedPerHour' - The average number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdMinimumNumberOfInstancesUsedPerHour' - The minimum number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+--+-- * 'rprdEstimatedBreakEvenInMonths' - How long AWS estimates that it takes for this instance to start saving you money, in months.+reservationPurchaseRecommendationDetail+ :: ReservationPurchaseRecommendationDetail+reservationPurchaseRecommendationDetail =+ ReservationPurchaseRecommendationDetail'+ { _rprdMaximumNormalizedUnitsUsedPerHour = Nothing+ , _rprdRecurringStandardMonthlyCost = Nothing+ , _rprdAverageNormalizedUnitsUsedPerHour = Nothing+ , _rprdCurrencyCode = Nothing+ , _rprdEstimatedMonthlySavingsPercentage = Nothing+ , _rprdRecommendedNormalizedUnitsToPurchase = Nothing+ , _rprdAverageUtilization = Nothing+ , _rprdEstimatedMonthlySavingsAmount = Nothing+ , _rprdUpfrontCost = Nothing+ , _rprdMinimumNormalizedUnitsUsedPerHour = Nothing+ , _rprdEstimatedMonthlyOnDemandCost = Nothing+ , _rprdRecommendedNumberOfInstancesToPurchase = Nothing+ , _rprdMaximumNumberOfInstancesUsedPerHour = Nothing+ , _rprdEstimatedReservationCostForLookbackPeriod = Nothing+ , _rprdInstanceDetails = Nothing+ , _rprdAverageNumberOfInstancesUsedPerHour = Nothing+ , _rprdMinimumNumberOfInstancesUsedPerHour = Nothing+ , _rprdEstimatedBreakEvenInMonths = Nothing+ }+++-- | The maximum number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+rprdMaximumNormalizedUnitsUsedPerHour :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdMaximumNormalizedUnitsUsedPerHour = lens _rprdMaximumNormalizedUnitsUsedPerHour (\ s a -> s{_rprdMaximumNormalizedUnitsUsedPerHour = a})++-- | How much purchasing this instance costs you on a monthly basis.+rprdRecurringStandardMonthlyCost :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdRecurringStandardMonthlyCost = lens _rprdRecurringStandardMonthlyCost (\ s a -> s{_rprdRecurringStandardMonthlyCost = a})++-- | The average number of normalized units that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+rprdAverageNormalizedUnitsUsedPerHour :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdAverageNormalizedUnitsUsedPerHour = lens _rprdAverageNormalizedUnitsUsedPerHour (\ s a -> s{_rprdAverageNormalizedUnitsUsedPerHour = a})++-- | The currency code that AWS used to calculate the costs for this instance.+rprdCurrencyCode :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdCurrencyCode = lens _rprdCurrencyCode (\ s a -> s{_rprdCurrencyCode = a})++-- | How much AWS estimates that this specific recommendation could save you in a month, as a percentage of your overall costs.+rprdEstimatedMonthlySavingsPercentage :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdEstimatedMonthlySavingsPercentage = lens _rprdEstimatedMonthlySavingsPercentage (\ s a -> s{_rprdEstimatedMonthlySavingsPercentage = a})++-- | The number of normalized units that AWS recommends that you purchase.+rprdRecommendedNormalizedUnitsToPurchase :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdRecommendedNormalizedUnitsToPurchase = lens _rprdRecommendedNormalizedUnitsToPurchase (\ s a -> s{_rprdRecommendedNormalizedUnitsToPurchase = a})++-- | The average utilization of your instances. AWS uses this to calculate your recommended reservation purchases.+rprdAverageUtilization :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdAverageUtilization = lens _rprdAverageUtilization (\ s a -> s{_rprdAverageUtilization = a})++-- | How much AWS estimates that this specific recommendation could save you in a month.+rprdEstimatedMonthlySavingsAmount :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdEstimatedMonthlySavingsAmount = lens _rprdEstimatedMonthlySavingsAmount (\ s a -> s{_rprdEstimatedMonthlySavingsAmount = a})++-- | How much purchasing this instance costs you upfront.+rprdUpfrontCost :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdUpfrontCost = lens _rprdUpfrontCost (\ s a -> s{_rprdUpfrontCost = a})++-- | The minimum number of hours that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+rprdMinimumNormalizedUnitsUsedPerHour :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdMinimumNormalizedUnitsUsedPerHour = lens _rprdMinimumNormalizedUnitsUsedPerHour (\ s a -> s{_rprdMinimumNormalizedUnitsUsedPerHour = a})++-- | How much AWS estimates that you spend on On-Demand Instances in a month.+rprdEstimatedMonthlyOnDemandCost :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdEstimatedMonthlyOnDemandCost = lens _rprdEstimatedMonthlyOnDemandCost (\ s a -> s{_rprdEstimatedMonthlyOnDemandCost = a})++-- | The number of instances that AWS recommends that you purchase.+rprdRecommendedNumberOfInstancesToPurchase :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdRecommendedNumberOfInstancesToPurchase = lens _rprdRecommendedNumberOfInstancesToPurchase (\ s a -> s{_rprdRecommendedNumberOfInstancesToPurchase = a})++-- | The maximum number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+rprdMaximumNumberOfInstancesUsedPerHour :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdMaximumNumberOfInstancesUsedPerHour = lens _rprdMaximumNumberOfInstancesUsedPerHour (\ s a -> s{_rprdMaximumNumberOfInstancesUsedPerHour = a})++-- | How much AWS estimates that you would have spent for all usage during the specified historical period if you had had a reservation.+rprdEstimatedReservationCostForLookbackPeriod :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdEstimatedReservationCostForLookbackPeriod = lens _rprdEstimatedReservationCostForLookbackPeriod (\ s a -> s{_rprdEstimatedReservationCostForLookbackPeriod = a})++-- | Details about the instances that AWS recommends that you purchase.+rprdInstanceDetails :: Lens' ReservationPurchaseRecommendationDetail (Maybe InstanceDetails)+rprdInstanceDetails = lens _rprdInstanceDetails (\ s a -> s{_rprdInstanceDetails = a})++-- | The average number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+rprdAverageNumberOfInstancesUsedPerHour :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdAverageNumberOfInstancesUsedPerHour = lens _rprdAverageNumberOfInstancesUsedPerHour (\ s a -> s{_rprdAverageNumberOfInstancesUsedPerHour = a})++-- | The minimum number of instances that you used in an hour during the historical period. AWS uses this to calculate your recommended reservation purchases.+rprdMinimumNumberOfInstancesUsedPerHour :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdMinimumNumberOfInstancesUsedPerHour = lens _rprdMinimumNumberOfInstancesUsedPerHour (\ s a -> s{_rprdMinimumNumberOfInstancesUsedPerHour = a})++-- | How long AWS estimates that it takes for this instance to start saving you money, in months.+rprdEstimatedBreakEvenInMonths :: Lens' ReservationPurchaseRecommendationDetail (Maybe Text)+rprdEstimatedBreakEvenInMonths = lens _rprdEstimatedBreakEvenInMonths (\ s a -> s{_rprdEstimatedBreakEvenInMonths = a})++instance FromJSON+ ReservationPurchaseRecommendationDetail+ where+ parseJSON+ = withObject+ "ReservationPurchaseRecommendationDetail"+ (\ x ->+ ReservationPurchaseRecommendationDetail' <$>+ (x .:? "MaximumNormalizedUnitsUsedPerHour") <*>+ (x .:? "RecurringStandardMonthlyCost")+ <*> (x .:? "AverageNormalizedUnitsUsedPerHour")+ <*> (x .:? "CurrencyCode")+ <*> (x .:? "EstimatedMonthlySavingsPercentage")+ <*> (x .:? "RecommendedNormalizedUnitsToPurchase")+ <*> (x .:? "AverageUtilization")+ <*> (x .:? "EstimatedMonthlySavingsAmount")+ <*> (x .:? "UpfrontCost")+ <*> (x .:? "MinimumNormalizedUnitsUsedPerHour")+ <*> (x .:? "EstimatedMonthlyOnDemandCost")+ <*> (x .:? "RecommendedNumberOfInstancesToPurchase")+ <*> (x .:? "MaximumNumberOfInstancesUsedPerHour")+ <*>+ (x .:? "EstimatedReservationCostForLookbackPeriod")+ <*> (x .:? "InstanceDetails")+ <*> (x .:? "AverageNumberOfInstancesUsedPerHour")+ <*> (x .:? "MinimumNumberOfInstancesUsedPerHour")+ <*> (x .:? "EstimatedBreakEvenInMonths"))++instance Hashable+ ReservationPurchaseRecommendationDetail+ where++instance NFData+ ReservationPurchaseRecommendationDetail+ where++-- | Information about this specific recommendation, such as the time stamp for when AWS made a specific recommendation.+--+--+--+-- /See:/ 'reservationPurchaseRecommendationMetadata' smart constructor.+data ReservationPurchaseRecommendationMetadata = ReservationPurchaseRecommendationMetadata'+ { _rprmRecommendationId :: !(Maybe Text)+ , _rprmGenerationTimestamp :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationPurchaseRecommendationMetadata' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rprmRecommendationId' - The ID for this specific recommendation.+--+-- * 'rprmGenerationTimestamp' - The time stamp for when AWS made this recommendation.+reservationPurchaseRecommendationMetadata+ :: ReservationPurchaseRecommendationMetadata+reservationPurchaseRecommendationMetadata =+ ReservationPurchaseRecommendationMetadata'+ {_rprmRecommendationId = Nothing, _rprmGenerationTimestamp = Nothing}+++-- | The ID for this specific recommendation.+rprmRecommendationId :: Lens' ReservationPurchaseRecommendationMetadata (Maybe Text)+rprmRecommendationId = lens _rprmRecommendationId (\ s a -> s{_rprmRecommendationId = a})++-- | The time stamp for when AWS made this recommendation.+rprmGenerationTimestamp :: Lens' ReservationPurchaseRecommendationMetadata (Maybe Text)+rprmGenerationTimestamp = lens _rprmGenerationTimestamp (\ s a -> s{_rprmGenerationTimestamp = a})++instance FromJSON+ ReservationPurchaseRecommendationMetadata+ where+ parseJSON+ = withObject+ "ReservationPurchaseRecommendationMetadata"+ (\ x ->+ ReservationPurchaseRecommendationMetadata' <$>+ (x .:? "RecommendationId") <*>+ (x .:? "GenerationTimestamp"))++instance Hashable+ ReservationPurchaseRecommendationMetadata+ where++instance NFData+ ReservationPurchaseRecommendationMetadata+ where++-- | A summary about this recommendation, such as the currency code, the amount that AWS estimates you could save, and the total amount of reservation to purchase.+--+--+--+-- /See:/ 'reservationPurchaseRecommendationSummary' smart constructor.+data ReservationPurchaseRecommendationSummary = ReservationPurchaseRecommendationSummary'+ { _rprsCurrencyCode :: !(Maybe Text)+ , _rprsTotalEstimatedMonthlySavingsPercentage :: !(Maybe Text)+ , _rprsTotalEstimatedMonthlySavingsAmount :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationPurchaseRecommendationSummary' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rprsCurrencyCode' - The currency code used for this recommendation.+--+-- * 'rprsTotalEstimatedMonthlySavingsPercentage' - The total amount that AWS estimates that this recommendation could save you in a month, as a percentage of your costs.+--+-- * 'rprsTotalEstimatedMonthlySavingsAmount' - The total amount that AWS estimates that this recommendation could save you in a month.+reservationPurchaseRecommendationSummary+ :: ReservationPurchaseRecommendationSummary+reservationPurchaseRecommendationSummary =+ ReservationPurchaseRecommendationSummary'+ { _rprsCurrencyCode = Nothing+ , _rprsTotalEstimatedMonthlySavingsPercentage = Nothing+ , _rprsTotalEstimatedMonthlySavingsAmount = Nothing+ }+++-- | The currency code used for this recommendation.+rprsCurrencyCode :: Lens' ReservationPurchaseRecommendationSummary (Maybe Text)+rprsCurrencyCode = lens _rprsCurrencyCode (\ s a -> s{_rprsCurrencyCode = a})++-- | The total amount that AWS estimates that this recommendation could save you in a month, as a percentage of your costs.+rprsTotalEstimatedMonthlySavingsPercentage :: Lens' ReservationPurchaseRecommendationSummary (Maybe Text)+rprsTotalEstimatedMonthlySavingsPercentage = lens _rprsTotalEstimatedMonthlySavingsPercentage (\ s a -> s{_rprsTotalEstimatedMonthlySavingsPercentage = a})++-- | The total amount that AWS estimates that this recommendation could save you in a month.+rprsTotalEstimatedMonthlySavingsAmount :: Lens' ReservationPurchaseRecommendationSummary (Maybe Text)+rprsTotalEstimatedMonthlySavingsAmount = lens _rprsTotalEstimatedMonthlySavingsAmount (\ s a -> s{_rprsTotalEstimatedMonthlySavingsAmount = a})++instance FromJSON+ ReservationPurchaseRecommendationSummary+ where+ parseJSON+ = withObject+ "ReservationPurchaseRecommendationSummary"+ (\ x ->+ ReservationPurchaseRecommendationSummary' <$>+ (x .:? "CurrencyCode") <*>+ (x .:? "TotalEstimatedMonthlySavingsPercentage")+ <*> (x .:? "TotalEstimatedMonthlySavingsAmount"))++instance Hashable+ ReservationPurchaseRecommendationSummary+ where++instance NFData+ ReservationPurchaseRecommendationSummary+ where++-- | A group of RIs that share a set of attributes.+--+--+--+-- /See:/ 'reservationUtilizationGroup' smart constructor.+data ReservationUtilizationGroup = ReservationUtilizationGroup'+ { _rugValue :: !(Maybe Text)+ , _rugKey :: !(Maybe Text)+ , _rugAttributes :: !(Maybe (Map Text Text))+ , _rugUtilization :: !(Maybe ReservationAggregates)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ReservationUtilizationGroup' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rugValue' - The value of a specific RI attribute.+--+-- * 'rugKey' - The key for a specific RI attribute.+--+-- * 'rugAttributes' - The attributes for this group of RIs.+--+-- * 'rugUtilization' - How much you used this group of RIs.+reservationUtilizationGroup+ :: ReservationUtilizationGroup+reservationUtilizationGroup =+ ReservationUtilizationGroup'+ { _rugValue = Nothing+ , _rugKey = Nothing+ , _rugAttributes = Nothing+ , _rugUtilization = Nothing+ }+++-- | The value of a specific RI attribute.+rugValue :: Lens' ReservationUtilizationGroup (Maybe Text)+rugValue = lens _rugValue (\ s a -> s{_rugValue = a})++-- | The key for a specific RI attribute.+rugKey :: Lens' ReservationUtilizationGroup (Maybe Text)+rugKey = lens _rugKey (\ s a -> s{_rugKey = a})++-- | The attributes for this group of RIs.+rugAttributes :: Lens' ReservationUtilizationGroup (HashMap Text Text)+rugAttributes = lens _rugAttributes (\ s a -> s{_rugAttributes = a}) . _Default . _Map++-- | How much you used this group of RIs.+rugUtilization :: Lens' ReservationUtilizationGroup (Maybe ReservationAggregates)+rugUtilization = lens _rugUtilization (\ s a -> s{_rugUtilization = a})++instance FromJSON ReservationUtilizationGroup where+ parseJSON+ = withObject "ReservationUtilizationGroup"+ (\ x ->+ ReservationUtilizationGroup' <$>+ (x .:? "Value") <*> (x .:? "Key") <*>+ (x .:? "Attributes" .!= mempty)+ <*> (x .:? "Utilization"))++instance Hashable ReservationUtilizationGroup where++instance NFData ReservationUtilizationGroup where++-- | The result that is associated with a time period.+--+--+--+-- /See:/ 'resultByTime' smart constructor.+data ResultByTime = ResultByTime'+ { _rbtGroups :: !(Maybe [Group])+ , _rbtTimePeriod :: !(Maybe DateInterval)+ , _rbtTotal :: !(Maybe (Map Text MetricValue))+ , _rbtEstimated :: !(Maybe Bool)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ResultByTime' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'rbtGroups' - The groups that are included in this time period.+--+-- * 'rbtTimePeriod' - The time period covered by a result.+--+-- * 'rbtTotal' - The total amount of cost or usage accrued during the time period.+--+-- * 'rbtEstimated' - Whether this result is estimated.+resultByTime+ :: ResultByTime+resultByTime =+ ResultByTime'+ { _rbtGroups = Nothing+ , _rbtTimePeriod = Nothing+ , _rbtTotal = Nothing+ , _rbtEstimated = Nothing+ }+++-- | The groups that are included in this time period.+rbtGroups :: Lens' ResultByTime [Group]+rbtGroups = lens _rbtGroups (\ s a -> s{_rbtGroups = a}) . _Default . _Coerce++-- | The time period covered by a result.+rbtTimePeriod :: Lens' ResultByTime (Maybe DateInterval)+rbtTimePeriod = lens _rbtTimePeriod (\ s a -> s{_rbtTimePeriod = a})++-- | The total amount of cost or usage accrued during the time period.+rbtTotal :: Lens' ResultByTime (HashMap Text MetricValue)+rbtTotal = lens _rbtTotal (\ s a -> s{_rbtTotal = a}) . _Default . _Map++-- | Whether this result is estimated.+rbtEstimated :: Lens' ResultByTime (Maybe Bool)+rbtEstimated = lens _rbtEstimated (\ s a -> s{_rbtEstimated = a})++instance FromJSON ResultByTime where+ parseJSON+ = withObject "ResultByTime"+ (\ x ->+ ResultByTime' <$>+ (x .:? "Groups" .!= mempty) <*> (x .:? "TimePeriod")+ <*> (x .:? "Total" .!= mempty)+ <*> (x .:? "Estimated"))++instance Hashable ResultByTime where++instance NFData ResultByTime where++-- | Hardware specifications for the service that you want recommendations for.+--+--+--+-- /See:/ 'serviceSpecification' smart constructor.+newtype ServiceSpecification = ServiceSpecification'+ { _ssEC2Specification :: Maybe EC2Specification+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'ServiceSpecification' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ssEC2Specification' - The EC2 hardware specifications that you want AWS to provide recommendations for.+serviceSpecification+ :: ServiceSpecification+serviceSpecification = ServiceSpecification' {_ssEC2Specification = Nothing}+++-- | The EC2 hardware specifications that you want AWS to provide recommendations for.+ssEC2Specification :: Lens' ServiceSpecification (Maybe EC2Specification)+ssEC2Specification = lens _ssEC2Specification (\ s a -> s{_ssEC2Specification = a})++instance FromJSON ServiceSpecification where+ parseJSON+ = withObject "ServiceSpecification"+ (\ x ->+ ServiceSpecification' <$> (x .:? "EC2Specification"))++instance Hashable ServiceSpecification where++instance NFData ServiceSpecification where++instance ToJSON ServiceSpecification where+ toJSON ServiceSpecification'{..}+ = object+ (catMaybes+ [("EC2Specification" .=) <$> _ssEC2Specification])++-- | The values that are available for a tag.+--+--+--+-- /See:/ 'tagValues' smart constructor.+data TagValues = TagValues'+ { _tvValues :: !(Maybe [Text])+ , _tvKey :: !(Maybe Text)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'TagValues' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'tvValues' - The specific value of a tag.+--+-- * 'tvKey' - The key for a tag.+tagValues+ :: TagValues+tagValues = TagValues' {_tvValues = Nothing, _tvKey = Nothing}+++-- | The specific value of a tag.+tvValues :: Lens' TagValues [Text]+tvValues = lens _tvValues (\ s a -> s{_tvValues = a}) . _Default . _Coerce++-- | The key for a tag.+tvKey :: Lens' TagValues (Maybe Text)+tvKey = lens _tvKey (\ s a -> s{_tvKey = a})++instance Hashable TagValues where++instance NFData TagValues where++instance ToJSON TagValues where+ toJSON TagValues'{..}+ = object+ (catMaybes+ [("Values" .=) <$> _tvValues, ("Key" .=) <$> _tvKey])++-- | The amount of utilization, in hours.+--+--+--+-- /See:/ 'utilizationByTime' smart constructor.+data UtilizationByTime = UtilizationByTime'+ { _ubtGroups :: !(Maybe [ReservationUtilizationGroup])+ , _ubtTimePeriod :: !(Maybe DateInterval)+ , _ubtTotal :: !(Maybe ReservationAggregates)+ } deriving (Eq, Read, Show, Data, Typeable, Generic)+++-- | Creates a value of 'UtilizationByTime' with the minimum fields required to make a request.+--+-- Use one of the following lenses to modify other fields as desired:+--+-- * 'ubtGroups' - The groups that are included in this utilization result.+--+-- * 'ubtTimePeriod' - The period of time over which this utilization was used.+--+-- * 'ubtTotal' - The total number of RI hours that were used.+utilizationByTime+ :: UtilizationByTime+utilizationByTime =+ UtilizationByTime'+ {_ubtGroups = Nothing, _ubtTimePeriod = Nothing, _ubtTotal = Nothing}+++-- | The groups that are included in this utilization result.+ubtGroups :: Lens' UtilizationByTime [ReservationUtilizationGroup]+ubtGroups = lens _ubtGroups (\ s a -> s{_ubtGroups = a}) . _Default . _Coerce++-- | The period of time over which this utilization was used.+ubtTimePeriod :: Lens' UtilizationByTime (Maybe DateInterval)+ubtTimePeriod = lens _ubtTimePeriod (\ s a -> s{_ubtTimePeriod = a})++-- | The total number of RI hours that were used.+ubtTotal :: Lens' UtilizationByTime (Maybe ReservationAggregates)+ubtTotal = lens _ubtTotal (\ s a -> s{_ubtTotal = a})++instance FromJSON UtilizationByTime where+ parseJSON+ = withObject "UtilizationByTime"+ (\ x ->+ UtilizationByTime' <$>+ (x .:? "Groups" .!= mempty) <*> (x .:? "TimePeriod")+ <*> (x .:? "Total"))++instance Hashable UtilizationByTime where++instance NFData UtilizationByTime where
+ gen/Network/AWS/CostExplorer/Types/Sum.hs view
@@ -0,0 +1,338 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.Types.Sum+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.CostExplorer.Types.Sum where++import Network.AWS.Prelude++data AccountScope =+ Payer+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText AccountScope where+ parser = takeLowerText >>= \case+ "payer" -> pure Payer+ e -> fromTextError $ "Failure parsing AccountScope from value: '" <> e+ <> "'. Accepted values: payer"++instance ToText AccountScope where+ toText = \case+ Payer -> "PAYER"++instance Hashable AccountScope+instance NFData AccountScope+instance ToByteString AccountScope+instance ToQuery AccountScope+instance ToHeader AccountScope++instance ToJSON AccountScope where+ toJSON = toJSONText++instance FromJSON AccountScope where+ parseJSON = parseJSONText "AccountScope"++data Context+ = CostAndUsage+ | Reservations+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText Context where+ parser = takeLowerText >>= \case+ "cost_and_usage" -> pure CostAndUsage+ "reservations" -> pure Reservations+ e -> fromTextError $ "Failure parsing Context from value: '" <> e+ <> "'. Accepted values: cost_and_usage, reservations"++instance ToText Context where+ toText = \case+ CostAndUsage -> "COST_AND_USAGE"+ Reservations -> "RESERVATIONS"++instance Hashable Context+instance NFData Context+instance ToByteString Context+instance ToQuery Context+instance ToHeader Context++instance ToJSON Context where+ toJSON = toJSONText++data Dimension+ = DimensionAZ+ | DimensionCacheEngine+ | DimensionDatabaseEngine+ | DimensionDeploymentOption+ | DimensionInstanceType+ | DimensionInstanceTypeFamily+ | DimensionLegalEntityName+ | DimensionLinkedAccount+ | DimensionOperatingSystem+ | DimensionOperation+ | DimensionPlatform+ | DimensionPurchaseType+ | DimensionRecordType+ | DimensionRegion+ | DimensionScope+ | DimensionService+ | DimensionSubscriptionId+ | DimensionTenancy+ | DimensionUsageType+ | DimensionUsageTypeGroup+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText Dimension where+ parser = takeLowerText >>= \case+ "az" -> pure DimensionAZ+ "cache_engine" -> pure DimensionCacheEngine+ "database_engine" -> pure DimensionDatabaseEngine+ "deployment_option" -> pure DimensionDeploymentOption+ "instance_type" -> pure DimensionInstanceType+ "instance_type_family" -> pure DimensionInstanceTypeFamily+ "legal_entity_name" -> pure DimensionLegalEntityName+ "linked_account" -> pure DimensionLinkedAccount+ "operating_system" -> pure DimensionOperatingSystem+ "operation" -> pure DimensionOperation+ "platform" -> pure DimensionPlatform+ "purchase_type" -> pure DimensionPurchaseType+ "record_type" -> pure DimensionRecordType+ "region" -> pure DimensionRegion+ "scope" -> pure DimensionScope+ "service" -> pure DimensionService+ "subscription_id" -> pure DimensionSubscriptionId+ "tenancy" -> pure DimensionTenancy+ "usage_type" -> pure DimensionUsageType+ "usage_type_group" -> pure DimensionUsageTypeGroup+ e -> fromTextError $ "Failure parsing Dimension from value: '" <> e+ <> "'. Accepted values: az, cache_engine, database_engine, deployment_option, instance_type, instance_type_family, legal_entity_name, linked_account, operating_system, operation, platform, purchase_type, record_type, region, scope, service, subscription_id, tenancy, usage_type, usage_type_group"++instance ToText Dimension where+ toText = \case+ DimensionAZ -> "AZ"+ DimensionCacheEngine -> "CACHE_ENGINE"+ DimensionDatabaseEngine -> "DATABASE_ENGINE"+ DimensionDeploymentOption -> "DEPLOYMENT_OPTION"+ DimensionInstanceType -> "INSTANCE_TYPE"+ DimensionInstanceTypeFamily -> "INSTANCE_TYPE_FAMILY"+ DimensionLegalEntityName -> "LEGAL_ENTITY_NAME"+ DimensionLinkedAccount -> "LINKED_ACCOUNT"+ DimensionOperatingSystem -> "OPERATING_SYSTEM"+ DimensionOperation -> "OPERATION"+ DimensionPlatform -> "PLATFORM"+ DimensionPurchaseType -> "PURCHASE_TYPE"+ DimensionRecordType -> "RECORD_TYPE"+ DimensionRegion -> "REGION"+ DimensionScope -> "SCOPE"+ DimensionService -> "SERVICE"+ DimensionSubscriptionId -> "SUBSCRIPTION_ID"+ DimensionTenancy -> "TENANCY"+ DimensionUsageType -> "USAGE_TYPE"+ DimensionUsageTypeGroup -> "USAGE_TYPE_GROUP"++instance Hashable Dimension+instance NFData Dimension+instance ToByteString Dimension+instance ToQuery Dimension+instance ToHeader Dimension++instance ToJSON Dimension where+ toJSON = toJSONText++data Granularity+ = Daily+ | Monthly+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText Granularity where+ parser = takeLowerText >>= \case+ "daily" -> pure Daily+ "monthly" -> pure Monthly+ e -> fromTextError $ "Failure parsing Granularity from value: '" <> e+ <> "'. Accepted values: daily, monthly"++instance ToText Granularity where+ toText = \case+ Daily -> "DAILY"+ Monthly -> "MONTHLY"++instance Hashable Granularity+instance NFData Granularity+instance ToByteString Granularity+instance ToQuery Granularity+instance ToHeader Granularity++instance ToJSON Granularity where+ toJSON = toJSONText++data GroupDefinitionType+ = Dimension+ | Tag+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText GroupDefinitionType where+ parser = takeLowerText >>= \case+ "dimension" -> pure Dimension+ "tag" -> pure Tag+ e -> fromTextError $ "Failure parsing GroupDefinitionType from value: '" <> e+ <> "'. Accepted values: dimension, tag"++instance ToText GroupDefinitionType where+ toText = \case+ Dimension -> "DIMENSION"+ Tag -> "TAG"++instance Hashable GroupDefinitionType+instance NFData GroupDefinitionType+instance ToByteString GroupDefinitionType+instance ToQuery GroupDefinitionType+instance ToHeader GroupDefinitionType++instance ToJSON GroupDefinitionType where+ toJSON = toJSONText++instance FromJSON GroupDefinitionType where+ parseJSON = parseJSONText "GroupDefinitionType"++data LookbackPeriodInDays+ = SevenDays+ | SixtyDays+ | ThirtyDays+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText LookbackPeriodInDays where+ parser = takeLowerText >>= \case+ "seven_days" -> pure SevenDays+ "sixty_days" -> pure SixtyDays+ "thirty_days" -> pure ThirtyDays+ e -> fromTextError $ "Failure parsing LookbackPeriodInDays from value: '" <> e+ <> "'. Accepted values: seven_days, sixty_days, thirty_days"++instance ToText LookbackPeriodInDays where+ toText = \case+ SevenDays -> "SEVEN_DAYS"+ SixtyDays -> "SIXTY_DAYS"+ ThirtyDays -> "THIRTY_DAYS"++instance Hashable LookbackPeriodInDays+instance NFData LookbackPeriodInDays+instance ToByteString LookbackPeriodInDays+instance ToQuery LookbackPeriodInDays+instance ToHeader LookbackPeriodInDays++instance ToJSON LookbackPeriodInDays where+ toJSON = toJSONText++instance FromJSON LookbackPeriodInDays where+ parseJSON = parseJSONText "LookbackPeriodInDays"++data OfferingClass+ = Convertible+ | Standard+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText OfferingClass where+ parser = takeLowerText >>= \case+ "convertible" -> pure Convertible+ "standard" -> pure Standard+ e -> fromTextError $ "Failure parsing OfferingClass from value: '" <> e+ <> "'. Accepted values: convertible, standard"++instance ToText OfferingClass where+ toText = \case+ Convertible -> "CONVERTIBLE"+ Standard -> "STANDARD"++instance Hashable OfferingClass+instance NFData OfferingClass+instance ToByteString OfferingClass+instance ToQuery OfferingClass+instance ToHeader OfferingClass++instance ToJSON OfferingClass where+ toJSON = toJSONText++instance FromJSON OfferingClass where+ parseJSON = parseJSONText "OfferingClass"++data PaymentOption+ = AllUpfront+ | NoUpfront+ | PartialUpfront+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText PaymentOption where+ parser = takeLowerText >>= \case+ "all_upfront" -> pure AllUpfront+ "no_upfront" -> pure NoUpfront+ "partial_upfront" -> pure PartialUpfront+ e -> fromTextError $ "Failure parsing PaymentOption from value: '" <> e+ <> "'. Accepted values: all_upfront, no_upfront, partial_upfront"++instance ToText PaymentOption where+ toText = \case+ AllUpfront -> "ALL_UPFRONT"+ NoUpfront -> "NO_UPFRONT"+ PartialUpfront -> "PARTIAL_UPFRONT"++instance Hashable PaymentOption+instance NFData PaymentOption+instance ToByteString PaymentOption+instance ToQuery PaymentOption+instance ToHeader PaymentOption++instance ToJSON PaymentOption where+ toJSON = toJSONText++instance FromJSON PaymentOption where+ parseJSON = parseJSONText "PaymentOption"++data TermInYears+ = OneYear+ | ThreeYears+ deriving (Eq, Ord, Read, Show, Enum, Bounded, Data, Typeable, Generic)+++instance FromText TermInYears where+ parser = takeLowerText >>= \case+ "one_year" -> pure OneYear+ "three_years" -> pure ThreeYears+ e -> fromTextError $ "Failure parsing TermInYears from value: '" <> e+ <> "'. Accepted values: one_year, three_years"++instance ToText TermInYears where+ toText = \case+ OneYear -> "ONE_YEAR"+ ThreeYears -> "THREE_YEARS"++instance Hashable TermInYears+instance NFData TermInYears+instance ToByteString TermInYears+instance ToQuery TermInYears+instance ToHeader TermInYears++instance ToJSON TermInYears where+ toJSON = toJSONText++instance FromJSON TermInYears where+ parseJSON = parseJSONText "TermInYears"
+ gen/Network/AWS/CostExplorer/Waiters.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeFamilies #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Network.AWS.CostExplorer.Waiters+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Network.AWS.CostExplorer.Waiters where++import Network.AWS.CostExplorer.Types+import Network.AWS.Lens+import Network.AWS.Prelude+import Network.AWS.Waiter
+ src/.gitkeep view
+ test/Main.hs view
@@ -0,0 +1,21 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Main+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Main (main) where++import Test.Tasty+import Test.AWS.CostExplorer+import Test.AWS.CostExplorer.Internal++main :: IO ()+main = defaultMain $ testGroup "CostExplorer"+ [ testGroup "tests" tests+ , testGroup "fixtures" fixtures+ ]
+ test/Test/AWS/CostExplorer.hs view
@@ -0,0 +1,20 @@+-- |+-- Module : Test.AWS.CostExplorer+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Test.AWS.CostExplorer+ ( tests+ , fixtures+ ) where++import Test.Tasty (TestTree)++tests :: [TestTree]+tests = []++fixtures :: [TestTree]+fixtures = []
+ test/Test/AWS/CostExplorer/Internal.hs view
@@ -0,0 +1,9 @@+-- |+-- Module : Test.AWS.CostExplorer.Internal+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Test.AWS.CostExplorer.Internal where
+ test/Test/AWS/Gen/CostExplorer.hs view
@@ -0,0 +1,147 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Test.AWS.Gen.CostExplorer+-- Copyright : (c) 2013-2018 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+amazonka@gmail.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+module Test.AWS.Gen.CostExplorer where++import Data.Proxy+import Network.AWS.CostExplorer+import Test.AWS.CostExplorer.Internal+import Test.AWS.Fixture+import Test.AWS.Prelude+import Test.Tasty++-- Auto-generated: the actual test selection needs to be manually placed into+-- the top-level so that real test data can be incrementally added.+--+-- This commented snippet is what the entire set should look like:++-- fixtures :: TestTree+-- fixtures =+-- [ testGroup "request"+-- [ requestGetReservationUtilization $+-- getReservationUtilization+--+-- , requestGetTags $+-- getTags+--+-- , requestGetReservationCoverage $+-- getReservationCoverage+--+-- , requestGetDimensionValues $+-- getDimensionValues+--+-- , requestGetReservationPurchaseRecommendation $+-- getReservationPurchaseRecommendation+--+-- , requestGetCostAndUsage $+-- getCostAndUsage+--+-- ]++-- , testGroup "response"+-- [ responseGetReservationUtilization $+-- getReservationUtilizationResponse+--+-- , responseGetTags $+-- getTagsResponse+--+-- , responseGetReservationCoverage $+-- getReservationCoverageResponse+--+-- , responseGetDimensionValues $+-- getDimensionValuesResponse+--+-- , responseGetReservationPurchaseRecommendation $+-- getReservationPurchaseRecommendationResponse+--+-- , responseGetCostAndUsage $+-- getCostAndUsageResponse+--+-- ]+-- ]++-- Requests++requestGetReservationUtilization :: GetReservationUtilization -> TestTree+requestGetReservationUtilization = req+ "GetReservationUtilization"+ "fixture/GetReservationUtilization.yaml"++requestGetTags :: GetTags -> TestTree+requestGetTags = req+ "GetTags"+ "fixture/GetTags.yaml"++requestGetReservationCoverage :: GetReservationCoverage -> TestTree+requestGetReservationCoverage = req+ "GetReservationCoverage"+ "fixture/GetReservationCoverage.yaml"++requestGetDimensionValues :: GetDimensionValues -> TestTree+requestGetDimensionValues = req+ "GetDimensionValues"+ "fixture/GetDimensionValues.yaml"++requestGetReservationPurchaseRecommendation :: GetReservationPurchaseRecommendation -> TestTree+requestGetReservationPurchaseRecommendation = req+ "GetReservationPurchaseRecommendation"+ "fixture/GetReservationPurchaseRecommendation.yaml"++requestGetCostAndUsage :: GetCostAndUsage -> TestTree+requestGetCostAndUsage = req+ "GetCostAndUsage"+ "fixture/GetCostAndUsage.yaml"++-- Responses++responseGetReservationUtilization :: GetReservationUtilizationResponse -> TestTree+responseGetReservationUtilization = res+ "GetReservationUtilizationResponse"+ "fixture/GetReservationUtilizationResponse.proto"+ costExplorer+ (Proxy :: Proxy GetReservationUtilization)++responseGetTags :: GetTagsResponse -> TestTree+responseGetTags = res+ "GetTagsResponse"+ "fixture/GetTagsResponse.proto"+ costExplorer+ (Proxy :: Proxy GetTags)++responseGetReservationCoverage :: GetReservationCoverageResponse -> TestTree+responseGetReservationCoverage = res+ "GetReservationCoverageResponse"+ "fixture/GetReservationCoverageResponse.proto"+ costExplorer+ (Proxy :: Proxy GetReservationCoverage)++responseGetDimensionValues :: GetDimensionValuesResponse -> TestTree+responseGetDimensionValues = res+ "GetDimensionValuesResponse"+ "fixture/GetDimensionValuesResponse.proto"+ costExplorer+ (Proxy :: Proxy GetDimensionValues)++responseGetReservationPurchaseRecommendation :: GetReservationPurchaseRecommendationResponse -> TestTree+responseGetReservationPurchaseRecommendation = res+ "GetReservationPurchaseRecommendationResponse"+ "fixture/GetReservationPurchaseRecommendationResponse.proto"+ costExplorer+ (Proxy :: Proxy GetReservationPurchaseRecommendation)++responseGetCostAndUsage :: GetCostAndUsageResponse -> TestTree+responseGetCostAndUsage = res+ "GetCostAndUsageResponse"+ "fixture/GetCostAndUsageResponse.proto"+ costExplorer+ (Proxy :: Proxy GetCostAndUsage)