amazonka-dlm (empty) → 2.0
raw patch · 68 files changed
+7170/−0 lines, 68 filesdep +amazonka-coredep +amazonka-dlmdep +amazonka-test
Dependencies added: amazonka-core, amazonka-dlm, amazonka-test, base, bytestring, case-insensitive, tasty, tasty-hunit, text, time, unordered-containers
Files
- LICENSE +367/−0
- README.md +44/−0
- amazonka-dlm.cabal +123/−0
- fixture/CreateLifecyclePolicy.yaml +10/−0
- fixture/CreateLifecyclePolicyResponse.proto +0/−0
- fixture/DeleteLifecyclePolicy.yaml +10/−0
- fixture/DeleteLifecyclePolicyResponse.proto +0/−0
- fixture/GetLifecyclePolicies.yaml +10/−0
- fixture/GetLifecyclePoliciesResponse.proto +0/−0
- fixture/GetLifecyclePolicy.yaml +10/−0
- fixture/GetLifecyclePolicyResponse.proto +0/−0
- fixture/ListTagsForResource.yaml +10/−0
- fixture/ListTagsForResourceResponse.proto +0/−0
- fixture/TagResource.yaml +10/−0
- fixture/TagResourceResponse.proto +0/−0
- fixture/UntagResource.yaml +10/−0
- fixture/UntagResourceResponse.proto +0/−0
- fixture/UpdateLifecyclePolicy.yaml +10/−0
- fixture/UpdateLifecyclePolicyResponse.proto +0/−0
- gen/Amazonka/DLM.hs +257/−0
- gen/Amazonka/DLM/CreateLifecyclePolicy.hs +240/−0
- gen/Amazonka/DLM/DeleteLifecyclePolicy.hs +151/−0
- gen/Amazonka/DLM/GetLifecyclePolicies.hs +248/−0
- gen/Amazonka/DLM/GetLifecyclePolicy.hs +159/−0
- gen/Amazonka/DLM/Lens.hs +229/−0
- gen/Amazonka/DLM/ListTagsForResource.hs +159/−0
- gen/Amazonka/DLM/TagResource.hs +163/−0
- gen/Amazonka/DLM/Types.hs +369/−0
- gen/Amazonka/DLM/Types/Action.hs +101/−0
- gen/Amazonka/DLM/Types/ArchiveRetainRule.hs +93/−0
- gen/Amazonka/DLM/Types/ArchiveRule.hs +78/−0
- gen/Amazonka/DLM/Types/CreateRule.hs +196/−0
- gen/Amazonka/DLM/Types/CrossRegionCopyAction.hs +121/−0
- gen/Amazonka/DLM/Types/CrossRegionCopyDeprecateRule.hs +114/−0
- gen/Amazonka/DLM/Types/CrossRegionCopyRetainRule.hs +110/−0
- gen/Amazonka/DLM/Types/CrossRegionCopyRule.hs +214/−0
- gen/Amazonka/DLM/Types/DeprecateRule.hs +132/−0
- gen/Amazonka/DLM/Types/EncryptionConfiguration.hs +111/−0
- gen/Amazonka/DLM/Types/EventParameters.hs +149/−0
- gen/Amazonka/DLM/Types/EventSource.hs +101/−0
- gen/Amazonka/DLM/Types/EventSourceValues.hs +66/−0
- gen/Amazonka/DLM/Types/EventTypeValues.hs +66/−0
- gen/Amazonka/DLM/Types/FastRestoreRule.hs +129/−0
- gen/Amazonka/DLM/Types/GettablePolicyStateValues.hs +76/−0
- gen/Amazonka/DLM/Types/IntervalUnitValues.hs +66/−0
- gen/Amazonka/DLM/Types/LifecyclePolicy.hs +186/−0
- gen/Amazonka/DLM/Types/LifecyclePolicySummary.hs +135/−0
- gen/Amazonka/DLM/Types/LocationValues.hs +71/−0
- gen/Amazonka/DLM/Types/Parameters.hs +167/−0
- gen/Amazonka/DLM/Types/PolicyDetails.hs +277/−0
- gen/Amazonka/DLM/Types/PolicyTypeValues.hs +76/−0
- gen/Amazonka/DLM/Types/ResourceLocationValues.hs +71/−0
- gen/Amazonka/DLM/Types/ResourceTypeValues.hs +71/−0
- gen/Amazonka/DLM/Types/RetainRule.hs +159/−0
- gen/Amazonka/DLM/Types/RetentionArchiveTier.hs +140/−0
- gen/Amazonka/DLM/Types/RetentionIntervalUnitValues.hs +81/−0
- gen/Amazonka/DLM/Types/Schedule.hs +284/−0
- gen/Amazonka/DLM/Types/SettablePolicyStateValues.hs +71/−0
- gen/Amazonka/DLM/Types/ShareRule.hs +120/−0
- gen/Amazonka/DLM/Types/Tag.hs +93/−0
- gen/Amazonka/DLM/UntagResource.hs +163/−0
- gen/Amazonka/DLM/UpdateLifecyclePolicy.hs +220/−0
- gen/Amazonka/DLM/Waiters.hs +24/−0
- src/.gitkeep +0/−0
- test/Main.hs +23/−0
- test/Test/Amazonka/DLM.hs +20/−0
- test/Test/Amazonka/DLM/Internal.hs +8/−0
- test/Test/Amazonka/Gen/DLM.hs +198/−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,44 @@+# Amazon Data Lifecycle Manager SDK++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version+ +`2.0` - Derived from API version @2018-01-12@ of the AWS service descriptions, licensed under Apache 2.0.++## Description++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-dlm)+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 [Amazonka.DLM](http://hackage.haskell.org/package/amazonka-dlm/docs/Amazonka-DLM.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-dlm` 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.
+ amazonka-dlm.cabal view
@@ -0,0 +1,123 @@+cabal-version: 2.2+name: amazonka-dlm+version: 2.0+synopsis: Amazon Data Lifecycle Manager 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>, Jack Kelly <jack@jackkelly.name>++copyright: Copyright (c) 2013-2023 Brendan Hay+category: AWS+build-type: Simple+extra-source-files:+ fixture/*.proto+ fixture/*.yaml+ README.md+ src/.gitkeep++description:+ Derived from API version @2018-01-12@ of the AWS service descriptions, licensed under Apache 2.0.+ .+ 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.+ .+ It is recommended to use generic lenses or optics from packages such as <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify optional fields and deconstruct responses.+ .+ Generated lenses can be found in "Amazonka.DLM.Lens" and are+ suitable for use with a lens package such as <http://hackage.haskell.org/package/lens lens> or <http://hackage.haskell.org/package/lens-family-core lens-family-core>.+ .+ See "Amazonka.DLM" and the <https://aws.amazon.com/documentation/ AWS documentation> to get started.++source-repository head+ type: git+ location: git://github.com/brendanhay/amazonka.git+ subdir: amazonka-dlm++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:+ Amazonka.DLM+ Amazonka.DLM.CreateLifecyclePolicy+ Amazonka.DLM.DeleteLifecyclePolicy+ Amazonka.DLM.GetLifecyclePolicies+ Amazonka.DLM.GetLifecyclePolicy+ Amazonka.DLM.Lens+ Amazonka.DLM.ListTagsForResource+ Amazonka.DLM.TagResource+ Amazonka.DLM.Types+ Amazonka.DLM.Types.Action+ Amazonka.DLM.Types.ArchiveRetainRule+ Amazonka.DLM.Types.ArchiveRule+ Amazonka.DLM.Types.CreateRule+ Amazonka.DLM.Types.CrossRegionCopyAction+ Amazonka.DLM.Types.CrossRegionCopyDeprecateRule+ Amazonka.DLM.Types.CrossRegionCopyRetainRule+ Amazonka.DLM.Types.CrossRegionCopyRule+ Amazonka.DLM.Types.DeprecateRule+ Amazonka.DLM.Types.EncryptionConfiguration+ Amazonka.DLM.Types.EventParameters+ Amazonka.DLM.Types.EventSource+ Amazonka.DLM.Types.EventSourceValues+ Amazonka.DLM.Types.EventTypeValues+ Amazonka.DLM.Types.FastRestoreRule+ Amazonka.DLM.Types.GettablePolicyStateValues+ Amazonka.DLM.Types.IntervalUnitValues+ Amazonka.DLM.Types.LifecyclePolicy+ Amazonka.DLM.Types.LifecyclePolicySummary+ Amazonka.DLM.Types.LocationValues+ Amazonka.DLM.Types.Parameters+ Amazonka.DLM.Types.PolicyDetails+ Amazonka.DLM.Types.PolicyTypeValues+ Amazonka.DLM.Types.ResourceLocationValues+ Amazonka.DLM.Types.ResourceTypeValues+ Amazonka.DLM.Types.RetainRule+ Amazonka.DLM.Types.RetentionArchiveTier+ Amazonka.DLM.Types.RetentionIntervalUnitValues+ Amazonka.DLM.Types.Schedule+ Amazonka.DLM.Types.SettablePolicyStateValues+ Amazonka.DLM.Types.ShareRule+ Amazonka.DLM.Types.Tag+ Amazonka.DLM.UntagResource+ Amazonka.DLM.UpdateLifecyclePolicy+ Amazonka.DLM.Waiters++ build-depends:+ , amazonka-core >=2.0 && <2.1+ , base >=4.12 && <5++test-suite amazonka-dlm-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.Amazonka.DLM+ Test.Amazonka.DLM.Internal+ Test.Amazonka.Gen.DLM++ build-depends:+ , amazonka-core >=2.0 && <2.1+ , amazonka-dlm+ , amazonka-test >=2.0 && <2.1+ , base+ , bytestring+ , case-insensitive+ , tasty+ , tasty-hunit+ , text+ , time+ , unordered-containers
+ fixture/CreateLifecyclePolicy.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/CreateLifecyclePolicyResponse.proto view
+ fixture/DeleteLifecyclePolicy.yaml view
@@ -0,0 +1,10 @@+---+method: DELETE+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/DeleteLifecyclePolicyResponse.proto view
+ fixture/GetLifecyclePolicies.yaml view
@@ -0,0 +1,10 @@+---+method: GET+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/GetLifecyclePoliciesResponse.proto view
+ fixture/GetLifecyclePolicy.yaml view
@@ -0,0 +1,10 @@+---+method: GET+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/GetLifecyclePolicyResponse.proto view
+ fixture/ListTagsForResource.yaml view
@@ -0,0 +1,10 @@+---+method: GET+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/ListTagsForResourceResponse.proto view
+ fixture/TagResource.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/TagResourceResponse.proto view
+ fixture/UntagResource.yaml view
@@ -0,0 +1,10 @@+---+method: DELETE+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/UntagResourceResponse.proto view
+ fixture/UpdateLifecyclePolicy.yaml view
@@ -0,0 +1,10 @@+---+method: PATCH+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/dlm/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: dlm.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/UpdateLifecyclePolicyResponse.proto view
+ gen/Amazonka/DLM.hs view
@@ -0,0 +1,257 @@+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Amazonka.DLM+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Derived from API version @2018-01-12@ of the AWS service descriptions, licensed under Apache 2.0.+--+-- Amazon Data Lifecycle Manager+--+-- With Amazon Data Lifecycle Manager, you can manage the lifecycle of your+-- Amazon Web Services resources. You create lifecycle policies, which are+-- used to automate operations on the specified resources.+--+-- Amazon Data Lifecycle Manager supports Amazon EBS volumes and snapshots.+-- For information about using Amazon Data Lifecycle Manager with Amazon+-- EBS, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html Amazon Data Lifecycle Manager>+-- in the /Amazon EC2 User Guide/.+module Amazonka.DLM+ ( -- * Service Configuration+ defaultService,++ -- * Errors+ -- $errors++ -- ** InternalServerException+ _InternalServerException,++ -- ** InvalidRequestException+ _InvalidRequestException,++ -- ** LimitExceededException+ _LimitExceededException,++ -- ** ResourceNotFoundException+ _ResourceNotFoundException,++ -- * Waiters+ -- $waiters++ -- * Operations+ -- $operations++ -- ** CreateLifecyclePolicy+ CreateLifecyclePolicy (CreateLifecyclePolicy'),+ newCreateLifecyclePolicy,+ CreateLifecyclePolicyResponse (CreateLifecyclePolicyResponse'),+ newCreateLifecyclePolicyResponse,++ -- ** DeleteLifecyclePolicy+ DeleteLifecyclePolicy (DeleteLifecyclePolicy'),+ newDeleteLifecyclePolicy,+ DeleteLifecyclePolicyResponse (DeleteLifecyclePolicyResponse'),+ newDeleteLifecyclePolicyResponse,++ -- ** GetLifecyclePolicies+ GetLifecyclePolicies (GetLifecyclePolicies'),+ newGetLifecyclePolicies,+ GetLifecyclePoliciesResponse (GetLifecyclePoliciesResponse'),+ newGetLifecyclePoliciesResponse,++ -- ** GetLifecyclePolicy+ GetLifecyclePolicy (GetLifecyclePolicy'),+ newGetLifecyclePolicy,+ GetLifecyclePolicyResponse (GetLifecyclePolicyResponse'),+ newGetLifecyclePolicyResponse,++ -- ** ListTagsForResource+ ListTagsForResource (ListTagsForResource'),+ newListTagsForResource,+ ListTagsForResourceResponse (ListTagsForResourceResponse'),+ newListTagsForResourceResponse,++ -- ** TagResource+ TagResource (TagResource'),+ newTagResource,+ TagResourceResponse (TagResourceResponse'),+ newTagResourceResponse,++ -- ** UntagResource+ UntagResource (UntagResource'),+ newUntagResource,+ UntagResourceResponse (UntagResourceResponse'),+ newUntagResourceResponse,++ -- ** UpdateLifecyclePolicy+ UpdateLifecyclePolicy (UpdateLifecyclePolicy'),+ newUpdateLifecyclePolicy,+ UpdateLifecyclePolicyResponse (UpdateLifecyclePolicyResponse'),+ newUpdateLifecyclePolicyResponse,++ -- * Types++ -- ** EventSourceValues+ EventSourceValues (..),++ -- ** EventTypeValues+ EventTypeValues (..),++ -- ** GettablePolicyStateValues+ GettablePolicyStateValues (..),++ -- ** IntervalUnitValues+ IntervalUnitValues (..),++ -- ** LocationValues+ LocationValues (..),++ -- ** PolicyTypeValues+ PolicyTypeValues (..),++ -- ** ResourceLocationValues+ ResourceLocationValues (..),++ -- ** ResourceTypeValues+ ResourceTypeValues (..),++ -- ** RetentionIntervalUnitValues+ RetentionIntervalUnitValues (..),++ -- ** SettablePolicyStateValues+ SettablePolicyStateValues (..),++ -- ** Action+ Action (Action'),+ newAction,++ -- ** ArchiveRetainRule+ ArchiveRetainRule (ArchiveRetainRule'),+ newArchiveRetainRule,++ -- ** ArchiveRule+ ArchiveRule (ArchiveRule'),+ newArchiveRule,++ -- ** CreateRule+ CreateRule (CreateRule'),+ newCreateRule,++ -- ** CrossRegionCopyAction+ CrossRegionCopyAction (CrossRegionCopyAction'),+ newCrossRegionCopyAction,++ -- ** CrossRegionCopyDeprecateRule+ CrossRegionCopyDeprecateRule (CrossRegionCopyDeprecateRule'),+ newCrossRegionCopyDeprecateRule,++ -- ** CrossRegionCopyRetainRule+ CrossRegionCopyRetainRule (CrossRegionCopyRetainRule'),+ newCrossRegionCopyRetainRule,++ -- ** CrossRegionCopyRule+ CrossRegionCopyRule (CrossRegionCopyRule'),+ newCrossRegionCopyRule,++ -- ** DeprecateRule+ DeprecateRule (DeprecateRule'),+ newDeprecateRule,++ -- ** EncryptionConfiguration+ EncryptionConfiguration (EncryptionConfiguration'),+ newEncryptionConfiguration,++ -- ** EventParameters+ EventParameters (EventParameters'),+ newEventParameters,++ -- ** EventSource+ EventSource (EventSource'),+ newEventSource,++ -- ** FastRestoreRule+ FastRestoreRule (FastRestoreRule'),+ newFastRestoreRule,++ -- ** LifecyclePolicy+ LifecyclePolicy (LifecyclePolicy'),+ newLifecyclePolicy,++ -- ** LifecyclePolicySummary+ LifecyclePolicySummary (LifecyclePolicySummary'),+ newLifecyclePolicySummary,++ -- ** Parameters+ Parameters (Parameters'),+ newParameters,++ -- ** PolicyDetails+ PolicyDetails (PolicyDetails'),+ newPolicyDetails,++ -- ** RetainRule+ RetainRule (RetainRule'),+ newRetainRule,++ -- ** RetentionArchiveTier+ RetentionArchiveTier (RetentionArchiveTier'),+ newRetentionArchiveTier,++ -- ** Schedule+ Schedule (Schedule'),+ newSchedule,++ -- ** ShareRule+ ShareRule (ShareRule'),+ newShareRule,++ -- ** Tag+ Tag (Tag'),+ newTag,+ )+where++import Amazonka.DLM.CreateLifecyclePolicy+import Amazonka.DLM.DeleteLifecyclePolicy+import Amazonka.DLM.GetLifecyclePolicies+import Amazonka.DLM.GetLifecyclePolicy+import Amazonka.DLM.Lens+import Amazonka.DLM.ListTagsForResource+import Amazonka.DLM.TagResource+import Amazonka.DLM.Types+import Amazonka.DLM.UntagResource+import Amazonka.DLM.UpdateLifecyclePolicy+import Amazonka.DLM.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 'DLM'.++-- $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/Amazonka/DLM/CreateLifecyclePolicy.hs view
@@ -0,0 +1,240 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.CreateLifecyclePolicy+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Creates a policy to manage the lifecycle of the specified Amazon Web+-- Services resources. You can create up to 100 lifecycle policies.+module Amazonka.DLM.CreateLifecyclePolicy+ ( -- * Creating a Request+ CreateLifecyclePolicy (..),+ newCreateLifecyclePolicy,++ -- * Request Lenses+ createLifecyclePolicy_tags,+ createLifecyclePolicy_executionRoleArn,+ createLifecyclePolicy_description,+ createLifecyclePolicy_state,+ createLifecyclePolicy_policyDetails,++ -- * Destructuring the Response+ CreateLifecyclePolicyResponse (..),+ newCreateLifecyclePolicyResponse,++ -- * Response Lenses+ createLifecyclePolicyResponse_policyId,+ createLifecyclePolicyResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newCreateLifecyclePolicy' smart constructor.+data CreateLifecyclePolicy = CreateLifecyclePolicy'+ { -- | The tags to apply to the lifecycle policy during creation.+ tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),+ -- | The Amazon Resource Name (ARN) of the IAM role used to run the+ -- operations specified by the lifecycle policy.+ executionRoleArn :: Prelude.Text,+ -- | A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$+ -- are supported.+ description :: Prelude.Text,+ -- | The desired activation state of the lifecycle policy after creation.+ state :: SettablePolicyStateValues,+ -- | The configuration details of the lifecycle policy.+ policyDetails :: PolicyDetails+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CreateLifecyclePolicy' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'tags', 'createLifecyclePolicy_tags' - The tags to apply to the lifecycle policy during creation.+--+-- 'executionRoleArn', 'createLifecyclePolicy_executionRoleArn' - The Amazon Resource Name (ARN) of the IAM role used to run the+-- operations specified by the lifecycle policy.+--+-- 'description', 'createLifecyclePolicy_description' - A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$+-- are supported.+--+-- 'state', 'createLifecyclePolicy_state' - The desired activation state of the lifecycle policy after creation.+--+-- 'policyDetails', 'createLifecyclePolicy_policyDetails' - The configuration details of the lifecycle policy.+newCreateLifecyclePolicy ::+ -- | 'executionRoleArn'+ Prelude.Text ->+ -- | 'description'+ Prelude.Text ->+ -- | 'state'+ SettablePolicyStateValues ->+ -- | 'policyDetails'+ PolicyDetails ->+ CreateLifecyclePolicy+newCreateLifecyclePolicy+ pExecutionRoleArn_+ pDescription_+ pState_+ pPolicyDetails_ =+ CreateLifecyclePolicy'+ { tags = Prelude.Nothing,+ executionRoleArn = pExecutionRoleArn_,+ description = pDescription_,+ state = pState_,+ policyDetails = pPolicyDetails_+ }++-- | The tags to apply to the lifecycle policy during creation.+createLifecyclePolicy_tags :: Lens.Lens' CreateLifecyclePolicy (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))+createLifecyclePolicy_tags = Lens.lens (\CreateLifecyclePolicy' {tags} -> tags) (\s@CreateLifecyclePolicy' {} a -> s {tags = a} :: CreateLifecyclePolicy) Prelude.. Lens.mapping Lens.coerced++-- | The Amazon Resource Name (ARN) of the IAM role used to run the+-- operations specified by the lifecycle policy.+createLifecyclePolicy_executionRoleArn :: Lens.Lens' CreateLifecyclePolicy Prelude.Text+createLifecyclePolicy_executionRoleArn = Lens.lens (\CreateLifecyclePolicy' {executionRoleArn} -> executionRoleArn) (\s@CreateLifecyclePolicy' {} a -> s {executionRoleArn = a} :: CreateLifecyclePolicy)++-- | A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$+-- are supported.+createLifecyclePolicy_description :: Lens.Lens' CreateLifecyclePolicy Prelude.Text+createLifecyclePolicy_description = Lens.lens (\CreateLifecyclePolicy' {description} -> description) (\s@CreateLifecyclePolicy' {} a -> s {description = a} :: CreateLifecyclePolicy)++-- | The desired activation state of the lifecycle policy after creation.+createLifecyclePolicy_state :: Lens.Lens' CreateLifecyclePolicy SettablePolicyStateValues+createLifecyclePolicy_state = Lens.lens (\CreateLifecyclePolicy' {state} -> state) (\s@CreateLifecyclePolicy' {} a -> s {state = a} :: CreateLifecyclePolicy)++-- | The configuration details of the lifecycle policy.+createLifecyclePolicy_policyDetails :: Lens.Lens' CreateLifecyclePolicy PolicyDetails+createLifecyclePolicy_policyDetails = Lens.lens (\CreateLifecyclePolicy' {policyDetails} -> policyDetails) (\s@CreateLifecyclePolicy' {} a -> s {policyDetails = a} :: CreateLifecyclePolicy)++instance Core.AWSRequest CreateLifecyclePolicy where+ type+ AWSResponse CreateLifecyclePolicy =+ CreateLifecyclePolicyResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ CreateLifecyclePolicyResponse'+ Prelude.<$> (x Data..?> "PolicyId")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable CreateLifecyclePolicy where+ hashWithSalt _salt CreateLifecyclePolicy' {..} =+ _salt+ `Prelude.hashWithSalt` tags+ `Prelude.hashWithSalt` executionRoleArn+ `Prelude.hashWithSalt` description+ `Prelude.hashWithSalt` state+ `Prelude.hashWithSalt` policyDetails++instance Prelude.NFData CreateLifecyclePolicy where+ rnf CreateLifecyclePolicy' {..} =+ Prelude.rnf tags+ `Prelude.seq` Prelude.rnf executionRoleArn+ `Prelude.seq` Prelude.rnf description+ `Prelude.seq` Prelude.rnf state+ `Prelude.seq` Prelude.rnf policyDetails++instance Data.ToHeaders CreateLifecyclePolicy where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON CreateLifecyclePolicy where+ toJSON CreateLifecyclePolicy' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Tags" Data..=) Prelude.<$> tags,+ Prelude.Just+ ("ExecutionRoleArn" Data..= executionRoleArn),+ Prelude.Just ("Description" Data..= description),+ Prelude.Just ("State" Data..= state),+ Prelude.Just+ ("PolicyDetails" Data..= policyDetails)+ ]+ )++instance Data.ToPath CreateLifecyclePolicy where+ toPath = Prelude.const "/policies"++instance Data.ToQuery CreateLifecyclePolicy where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newCreateLifecyclePolicyResponse' smart constructor.+data CreateLifecyclePolicyResponse = CreateLifecyclePolicyResponse'+ { -- | The identifier of the lifecycle policy.+ policyId :: Prelude.Maybe Prelude.Text,+ -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CreateLifecyclePolicyResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'policyId', 'createLifecyclePolicyResponse_policyId' - The identifier of the lifecycle policy.+--+-- 'httpStatus', 'createLifecyclePolicyResponse_httpStatus' - The response's http status code.+newCreateLifecyclePolicyResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ CreateLifecyclePolicyResponse+newCreateLifecyclePolicyResponse pHttpStatus_ =+ CreateLifecyclePolicyResponse'+ { policyId =+ Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | The identifier of the lifecycle policy.+createLifecyclePolicyResponse_policyId :: Lens.Lens' CreateLifecyclePolicyResponse (Prelude.Maybe Prelude.Text)+createLifecyclePolicyResponse_policyId = Lens.lens (\CreateLifecyclePolicyResponse' {policyId} -> policyId) (\s@CreateLifecyclePolicyResponse' {} a -> s {policyId = a} :: CreateLifecyclePolicyResponse)++-- | The response's http status code.+createLifecyclePolicyResponse_httpStatus :: Lens.Lens' CreateLifecyclePolicyResponse Prelude.Int+createLifecyclePolicyResponse_httpStatus = Lens.lens (\CreateLifecyclePolicyResponse' {httpStatus} -> httpStatus) (\s@CreateLifecyclePolicyResponse' {} a -> s {httpStatus = a} :: CreateLifecyclePolicyResponse)++instance Prelude.NFData CreateLifecyclePolicyResponse where+ rnf CreateLifecyclePolicyResponse' {..} =+ Prelude.rnf policyId+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/DLM/DeleteLifecyclePolicy.hs view
@@ -0,0 +1,151 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.DeleteLifecyclePolicy+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Deletes the specified lifecycle policy and halts the automated+-- operations that the policy specified.+--+-- For more information about deleting a policy, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/view-modify-delete.html#delete Delete lifecycle policies>.+module Amazonka.DLM.DeleteLifecyclePolicy+ ( -- * Creating a Request+ DeleteLifecyclePolicy (..),+ newDeleteLifecyclePolicy,++ -- * Request Lenses+ deleteLifecyclePolicy_policyId,++ -- * Destructuring the Response+ DeleteLifecyclePolicyResponse (..),+ newDeleteLifecyclePolicyResponse,++ -- * Response Lenses+ deleteLifecyclePolicyResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newDeleteLifecyclePolicy' smart constructor.+data DeleteLifecyclePolicy = DeleteLifecyclePolicy'+ { -- | The identifier of the lifecycle policy.+ policyId :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'DeleteLifecyclePolicy' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'policyId', 'deleteLifecyclePolicy_policyId' - The identifier of the lifecycle policy.+newDeleteLifecyclePolicy ::+ -- | 'policyId'+ Prelude.Text ->+ DeleteLifecyclePolicy+newDeleteLifecyclePolicy pPolicyId_ =+ DeleteLifecyclePolicy' {policyId = pPolicyId_}++-- | The identifier of the lifecycle policy.+deleteLifecyclePolicy_policyId :: Lens.Lens' DeleteLifecyclePolicy Prelude.Text+deleteLifecyclePolicy_policyId = Lens.lens (\DeleteLifecyclePolicy' {policyId} -> policyId) (\s@DeleteLifecyclePolicy' {} a -> s {policyId = a} :: DeleteLifecyclePolicy)++instance Core.AWSRequest DeleteLifecyclePolicy where+ type+ AWSResponse DeleteLifecyclePolicy =+ DeleteLifecyclePolicyResponse+ request overrides =+ Request.delete (overrides defaultService)+ response =+ Response.receiveEmpty+ ( \s h x ->+ DeleteLifecyclePolicyResponse'+ Prelude.<$> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable DeleteLifecyclePolicy where+ hashWithSalt _salt DeleteLifecyclePolicy' {..} =+ _salt `Prelude.hashWithSalt` policyId++instance Prelude.NFData DeleteLifecyclePolicy where+ rnf DeleteLifecyclePolicy' {..} = Prelude.rnf policyId++instance Data.ToHeaders DeleteLifecyclePolicy where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToPath DeleteLifecyclePolicy where+ toPath DeleteLifecyclePolicy' {..} =+ Prelude.mconcat+ ["/policies/", Data.toBS policyId, "/"]++instance Data.ToQuery DeleteLifecyclePolicy where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newDeleteLifecyclePolicyResponse' smart constructor.+data DeleteLifecyclePolicyResponse = DeleteLifecyclePolicyResponse'+ { -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'DeleteLifecyclePolicyResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'httpStatus', 'deleteLifecyclePolicyResponse_httpStatus' - The response's http status code.+newDeleteLifecyclePolicyResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ DeleteLifecyclePolicyResponse+newDeleteLifecyclePolicyResponse pHttpStatus_ =+ DeleteLifecyclePolicyResponse'+ { httpStatus =+ pHttpStatus_+ }++-- | The response's http status code.+deleteLifecyclePolicyResponse_httpStatus :: Lens.Lens' DeleteLifecyclePolicyResponse Prelude.Int+deleteLifecyclePolicyResponse_httpStatus = Lens.lens (\DeleteLifecyclePolicyResponse' {httpStatus} -> httpStatus) (\s@DeleteLifecyclePolicyResponse' {} a -> s {httpStatus = a} :: DeleteLifecyclePolicyResponse)++instance Prelude.NFData DeleteLifecyclePolicyResponse where+ rnf DeleteLifecyclePolicyResponse' {..} =+ Prelude.rnf httpStatus
+ gen/Amazonka/DLM/GetLifecyclePolicies.hs view
@@ -0,0 +1,248 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.GetLifecyclePolicies+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets summary information about all or the specified data lifecycle+-- policies.+--+-- To get complete information about a policy, use GetLifecyclePolicy.+module Amazonka.DLM.GetLifecyclePolicies+ ( -- * Creating a Request+ GetLifecyclePolicies (..),+ newGetLifecyclePolicies,++ -- * Request Lenses+ getLifecyclePolicies_policyIds,+ getLifecyclePolicies_resourceTypes,+ getLifecyclePolicies_state,+ getLifecyclePolicies_tagsToAdd,+ getLifecyclePolicies_targetTags,++ -- * Destructuring the Response+ GetLifecyclePoliciesResponse (..),+ newGetLifecyclePoliciesResponse,++ -- * Response Lenses+ getLifecyclePoliciesResponse_policies,+ getLifecyclePoliciesResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newGetLifecyclePolicies' smart constructor.+data GetLifecyclePolicies = GetLifecyclePolicies'+ { -- | The identifiers of the data lifecycle policies.+ policyIds :: Prelude.Maybe [Prelude.Text],+ -- | The resource type.+ resourceTypes :: Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues),+ -- | The activation state.+ state :: Prelude.Maybe GettablePolicyStateValues,+ -- | The tags to add to objects created by the policy.+ --+ -- Tags are strings in the format @key=value@.+ --+ -- These user-defined tags are added in addition to the Amazon Web+ -- Services-added lifecycle tags.+ tagsToAdd :: Prelude.Maybe [Prelude.Text],+ -- | The target tag for a policy.+ --+ -- Tags are strings in the format @key=value@.+ targetTags :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'GetLifecyclePolicies' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'policyIds', 'getLifecyclePolicies_policyIds' - The identifiers of the data lifecycle policies.+--+-- 'resourceTypes', 'getLifecyclePolicies_resourceTypes' - The resource type.+--+-- 'state', 'getLifecyclePolicies_state' - The activation state.+--+-- 'tagsToAdd', 'getLifecyclePolicies_tagsToAdd' - The tags to add to objects created by the policy.+--+-- Tags are strings in the format @key=value@.+--+-- These user-defined tags are added in addition to the Amazon Web+-- Services-added lifecycle tags.+--+-- 'targetTags', 'getLifecyclePolicies_targetTags' - The target tag for a policy.+--+-- Tags are strings in the format @key=value@.+newGetLifecyclePolicies ::+ GetLifecyclePolicies+newGetLifecyclePolicies =+ GetLifecyclePolicies'+ { policyIds = Prelude.Nothing,+ resourceTypes = Prelude.Nothing,+ state = Prelude.Nothing,+ tagsToAdd = Prelude.Nothing,+ targetTags = Prelude.Nothing+ }++-- | The identifiers of the data lifecycle policies.+getLifecyclePolicies_policyIds :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe [Prelude.Text])+getLifecyclePolicies_policyIds = Lens.lens (\GetLifecyclePolicies' {policyIds} -> policyIds) (\s@GetLifecyclePolicies' {} a -> s {policyIds = a} :: GetLifecyclePolicies) Prelude.. Lens.mapping Lens.coerced++-- | The resource type.+getLifecyclePolicies_resourceTypes :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues))+getLifecyclePolicies_resourceTypes = Lens.lens (\GetLifecyclePolicies' {resourceTypes} -> resourceTypes) (\s@GetLifecyclePolicies' {} a -> s {resourceTypes = a} :: GetLifecyclePolicies) Prelude.. Lens.mapping Lens.coerced++-- | The activation state.+getLifecyclePolicies_state :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe GettablePolicyStateValues)+getLifecyclePolicies_state = Lens.lens (\GetLifecyclePolicies' {state} -> state) (\s@GetLifecyclePolicies' {} a -> s {state = a} :: GetLifecyclePolicies)++-- | The tags to add to objects created by the policy.+--+-- Tags are strings in the format @key=value@.+--+-- These user-defined tags are added in addition to the Amazon Web+-- Services-added lifecycle tags.+getLifecyclePolicies_tagsToAdd :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe [Prelude.Text])+getLifecyclePolicies_tagsToAdd = Lens.lens (\GetLifecyclePolicies' {tagsToAdd} -> tagsToAdd) (\s@GetLifecyclePolicies' {} a -> s {tagsToAdd = a} :: GetLifecyclePolicies) Prelude.. Lens.mapping Lens.coerced++-- | The target tag for a policy.+--+-- Tags are strings in the format @key=value@.+getLifecyclePolicies_targetTags :: Lens.Lens' GetLifecyclePolicies (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))+getLifecyclePolicies_targetTags = Lens.lens (\GetLifecyclePolicies' {targetTags} -> targetTags) (\s@GetLifecyclePolicies' {} a -> s {targetTags = a} :: GetLifecyclePolicies) Prelude.. Lens.mapping Lens.coerced++instance Core.AWSRequest GetLifecyclePolicies where+ type+ AWSResponse GetLifecyclePolicies =+ GetLifecyclePoliciesResponse+ request overrides =+ Request.get (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ GetLifecyclePoliciesResponse'+ Prelude.<$> (x Data..?> "Policies" Core..!@ Prelude.mempty)+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable GetLifecyclePolicies where+ hashWithSalt _salt GetLifecyclePolicies' {..} =+ _salt+ `Prelude.hashWithSalt` policyIds+ `Prelude.hashWithSalt` resourceTypes+ `Prelude.hashWithSalt` state+ `Prelude.hashWithSalt` tagsToAdd+ `Prelude.hashWithSalt` targetTags++instance Prelude.NFData GetLifecyclePolicies where+ rnf GetLifecyclePolicies' {..} =+ Prelude.rnf policyIds+ `Prelude.seq` Prelude.rnf resourceTypes+ `Prelude.seq` Prelude.rnf state+ `Prelude.seq` Prelude.rnf tagsToAdd+ `Prelude.seq` Prelude.rnf targetTags++instance Data.ToHeaders GetLifecyclePolicies where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToPath GetLifecyclePolicies where+ toPath = Prelude.const "/policies"++instance Data.ToQuery GetLifecyclePolicies where+ toQuery GetLifecyclePolicies' {..} =+ Prelude.mconcat+ [ "policyIds"+ Data.=: Data.toQuery+ (Data.toQueryList "member" Prelude.<$> policyIds),+ "resourceTypes"+ Data.=: Data.toQuery+ ( Data.toQueryList "member"+ Prelude.<$> resourceTypes+ ),+ "state" Data.=: state,+ "tagsToAdd"+ Data.=: Data.toQuery+ (Data.toQueryList "member" Prelude.<$> tagsToAdd),+ "targetTags"+ Data.=: Data.toQuery+ (Data.toQueryList "member" Prelude.<$> targetTags)+ ]++-- | /See:/ 'newGetLifecyclePoliciesResponse' smart constructor.+data GetLifecyclePoliciesResponse = GetLifecyclePoliciesResponse'+ { -- | Summary information about the lifecycle policies.+ policies :: Prelude.Maybe [LifecyclePolicySummary],+ -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'GetLifecyclePoliciesResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'policies', 'getLifecyclePoliciesResponse_policies' - Summary information about the lifecycle policies.+--+-- 'httpStatus', 'getLifecyclePoliciesResponse_httpStatus' - The response's http status code.+newGetLifecyclePoliciesResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ GetLifecyclePoliciesResponse+newGetLifecyclePoliciesResponse pHttpStatus_ =+ GetLifecyclePoliciesResponse'+ { policies =+ Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | Summary information about the lifecycle policies.+getLifecyclePoliciesResponse_policies :: Lens.Lens' GetLifecyclePoliciesResponse (Prelude.Maybe [LifecyclePolicySummary])+getLifecyclePoliciesResponse_policies = Lens.lens (\GetLifecyclePoliciesResponse' {policies} -> policies) (\s@GetLifecyclePoliciesResponse' {} a -> s {policies = a} :: GetLifecyclePoliciesResponse) Prelude.. Lens.mapping Lens.coerced++-- | The response's http status code.+getLifecyclePoliciesResponse_httpStatus :: Lens.Lens' GetLifecyclePoliciesResponse Prelude.Int+getLifecyclePoliciesResponse_httpStatus = Lens.lens (\GetLifecyclePoliciesResponse' {httpStatus} -> httpStatus) (\s@GetLifecyclePoliciesResponse' {} a -> s {httpStatus = a} :: GetLifecyclePoliciesResponse)++instance Prelude.NFData GetLifecyclePoliciesResponse where+ rnf GetLifecyclePoliciesResponse' {..} =+ Prelude.rnf policies+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/DLM/GetLifecyclePolicy.hs view
@@ -0,0 +1,159 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.GetLifecyclePolicy+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Gets detailed information about the specified lifecycle policy.+module Amazonka.DLM.GetLifecyclePolicy+ ( -- * Creating a Request+ GetLifecyclePolicy (..),+ newGetLifecyclePolicy,++ -- * Request Lenses+ getLifecyclePolicy_policyId,++ -- * Destructuring the Response+ GetLifecyclePolicyResponse (..),+ newGetLifecyclePolicyResponse,++ -- * Response Lenses+ getLifecyclePolicyResponse_policy,+ getLifecyclePolicyResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newGetLifecyclePolicy' smart constructor.+data GetLifecyclePolicy = GetLifecyclePolicy'+ { -- | The identifier of the lifecycle policy.+ policyId :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'GetLifecyclePolicy' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'policyId', 'getLifecyclePolicy_policyId' - The identifier of the lifecycle policy.+newGetLifecyclePolicy ::+ -- | 'policyId'+ Prelude.Text ->+ GetLifecyclePolicy+newGetLifecyclePolicy pPolicyId_ =+ GetLifecyclePolicy' {policyId = pPolicyId_}++-- | The identifier of the lifecycle policy.+getLifecyclePolicy_policyId :: Lens.Lens' GetLifecyclePolicy Prelude.Text+getLifecyclePolicy_policyId = Lens.lens (\GetLifecyclePolicy' {policyId} -> policyId) (\s@GetLifecyclePolicy' {} a -> s {policyId = a} :: GetLifecyclePolicy)++instance Core.AWSRequest GetLifecyclePolicy where+ type+ AWSResponse GetLifecyclePolicy =+ GetLifecyclePolicyResponse+ request overrides =+ Request.get (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ GetLifecyclePolicyResponse'+ Prelude.<$> (x Data..?> "Policy")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable GetLifecyclePolicy where+ hashWithSalt _salt GetLifecyclePolicy' {..} =+ _salt `Prelude.hashWithSalt` policyId++instance Prelude.NFData GetLifecyclePolicy where+ rnf GetLifecyclePolicy' {..} = Prelude.rnf policyId++instance Data.ToHeaders GetLifecyclePolicy where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToPath GetLifecyclePolicy where+ toPath GetLifecyclePolicy' {..} =+ Prelude.mconcat+ ["/policies/", Data.toBS policyId, "/"]++instance Data.ToQuery GetLifecyclePolicy where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newGetLifecyclePolicyResponse' smart constructor.+data GetLifecyclePolicyResponse = GetLifecyclePolicyResponse'+ { -- | Detailed information about the lifecycle policy.+ policy :: Prelude.Maybe LifecyclePolicy,+ -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'GetLifecyclePolicyResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'policy', 'getLifecyclePolicyResponse_policy' - Detailed information about the lifecycle policy.+--+-- 'httpStatus', 'getLifecyclePolicyResponse_httpStatus' - The response's http status code.+newGetLifecyclePolicyResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ GetLifecyclePolicyResponse+newGetLifecyclePolicyResponse pHttpStatus_ =+ GetLifecyclePolicyResponse'+ { policy =+ Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | Detailed information about the lifecycle policy.+getLifecyclePolicyResponse_policy :: Lens.Lens' GetLifecyclePolicyResponse (Prelude.Maybe LifecyclePolicy)+getLifecyclePolicyResponse_policy = Lens.lens (\GetLifecyclePolicyResponse' {policy} -> policy) (\s@GetLifecyclePolicyResponse' {} a -> s {policy = a} :: GetLifecyclePolicyResponse)++-- | The response's http status code.+getLifecyclePolicyResponse_httpStatus :: Lens.Lens' GetLifecyclePolicyResponse Prelude.Int+getLifecyclePolicyResponse_httpStatus = Lens.lens (\GetLifecyclePolicyResponse' {httpStatus} -> httpStatus) (\s@GetLifecyclePolicyResponse' {} a -> s {httpStatus = a} :: GetLifecyclePolicyResponse)++instance Prelude.NFData GetLifecyclePolicyResponse where+ rnf GetLifecyclePolicyResponse' {..} =+ Prelude.rnf policy+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/DLM/Lens.hs view
@@ -0,0 +1,229 @@+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Lens+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Lens+ ( -- * Operations++ -- ** CreateLifecyclePolicy+ createLifecyclePolicy_tags,+ createLifecyclePolicy_executionRoleArn,+ createLifecyclePolicy_description,+ createLifecyclePolicy_state,+ createLifecyclePolicy_policyDetails,+ createLifecyclePolicyResponse_policyId,+ createLifecyclePolicyResponse_httpStatus,++ -- ** DeleteLifecyclePolicy+ deleteLifecyclePolicy_policyId,+ deleteLifecyclePolicyResponse_httpStatus,++ -- ** GetLifecyclePolicies+ getLifecyclePolicies_policyIds,+ getLifecyclePolicies_resourceTypes,+ getLifecyclePolicies_state,+ getLifecyclePolicies_tagsToAdd,+ getLifecyclePolicies_targetTags,+ getLifecyclePoliciesResponse_policies,+ getLifecyclePoliciesResponse_httpStatus,++ -- ** GetLifecyclePolicy+ getLifecyclePolicy_policyId,+ getLifecyclePolicyResponse_policy,+ getLifecyclePolicyResponse_httpStatus,++ -- ** ListTagsForResource+ listTagsForResource_resourceArn,+ listTagsForResourceResponse_tags,+ listTagsForResourceResponse_httpStatus,++ -- ** TagResource+ tagResource_resourceArn,+ tagResource_tags,+ tagResourceResponse_httpStatus,++ -- ** UntagResource+ untagResource_resourceArn,+ untagResource_tagKeys,+ untagResourceResponse_httpStatus,++ -- ** UpdateLifecyclePolicy+ updateLifecyclePolicy_description,+ updateLifecyclePolicy_executionRoleArn,+ updateLifecyclePolicy_policyDetails,+ updateLifecyclePolicy_state,+ updateLifecyclePolicy_policyId,+ updateLifecyclePolicyResponse_httpStatus,++ -- * Types++ -- ** Action+ action_name,+ action_crossRegionCopy,++ -- ** ArchiveRetainRule+ archiveRetainRule_retentionArchiveTier,++ -- ** ArchiveRule+ archiveRule_retainRule,++ -- ** CreateRule+ createRule_cronExpression,+ createRule_interval,+ createRule_intervalUnit,+ createRule_location,+ createRule_times,++ -- ** CrossRegionCopyAction+ crossRegionCopyAction_retainRule,+ crossRegionCopyAction_target,+ crossRegionCopyAction_encryptionConfiguration,++ -- ** CrossRegionCopyDeprecateRule+ crossRegionCopyDeprecateRule_interval,+ crossRegionCopyDeprecateRule_intervalUnit,++ -- ** CrossRegionCopyRetainRule+ crossRegionCopyRetainRule_interval,+ crossRegionCopyRetainRule_intervalUnit,++ -- ** CrossRegionCopyRule+ crossRegionCopyRule_cmkArn,+ crossRegionCopyRule_copyTags,+ crossRegionCopyRule_deprecateRule,+ crossRegionCopyRule_retainRule,+ crossRegionCopyRule_target,+ crossRegionCopyRule_targetRegion,+ crossRegionCopyRule_encrypted,++ -- ** DeprecateRule+ deprecateRule_count,+ deprecateRule_interval,+ deprecateRule_intervalUnit,++ -- ** EncryptionConfiguration+ encryptionConfiguration_cmkArn,+ encryptionConfiguration_encrypted,++ -- ** EventParameters+ eventParameters_eventType,+ eventParameters_snapshotOwner,+ eventParameters_descriptionRegex,++ -- ** EventSource+ eventSource_parameters,+ eventSource_type,++ -- ** FastRestoreRule+ fastRestoreRule_count,+ fastRestoreRule_interval,+ fastRestoreRule_intervalUnit,+ fastRestoreRule_availabilityZones,++ -- ** LifecyclePolicy+ lifecyclePolicy_dateCreated,+ lifecyclePolicy_dateModified,+ lifecyclePolicy_description,+ lifecyclePolicy_executionRoleArn,+ lifecyclePolicy_policyArn,+ lifecyclePolicy_policyDetails,+ lifecyclePolicy_policyId,+ lifecyclePolicy_state,+ lifecyclePolicy_statusMessage,+ lifecyclePolicy_tags,++ -- ** LifecyclePolicySummary+ lifecyclePolicySummary_description,+ lifecyclePolicySummary_policyId,+ lifecyclePolicySummary_policyType,+ lifecyclePolicySummary_state,+ lifecyclePolicySummary_tags,++ -- ** Parameters+ parameters_excludeBootVolume,+ parameters_excludeDataVolumeTags,+ parameters_noReboot,++ -- ** PolicyDetails+ policyDetails_actions,+ policyDetails_eventSource,+ policyDetails_parameters,+ policyDetails_policyType,+ policyDetails_resourceLocations,+ policyDetails_resourceTypes,+ policyDetails_schedules,+ policyDetails_targetTags,++ -- ** RetainRule+ retainRule_count,+ retainRule_interval,+ retainRule_intervalUnit,++ -- ** RetentionArchiveTier+ retentionArchiveTier_count,+ retentionArchiveTier_interval,+ retentionArchiveTier_intervalUnit,++ -- ** Schedule+ schedule_archiveRule,+ schedule_copyTags,+ schedule_createRule,+ schedule_crossRegionCopyRules,+ schedule_deprecateRule,+ schedule_fastRestoreRule,+ schedule_name,+ schedule_retainRule,+ schedule_shareRules,+ schedule_tagsToAdd,+ schedule_variableTags,++ -- ** ShareRule+ shareRule_unshareInterval,+ shareRule_unshareIntervalUnit,+ shareRule_targetAccounts,++ -- ** Tag+ tag_key,+ tag_value,+ )+where++import Amazonka.DLM.CreateLifecyclePolicy+import Amazonka.DLM.DeleteLifecyclePolicy+import Amazonka.DLM.GetLifecyclePolicies+import Amazonka.DLM.GetLifecyclePolicy+import Amazonka.DLM.ListTagsForResource+import Amazonka.DLM.TagResource+import Amazonka.DLM.Types.Action+import Amazonka.DLM.Types.ArchiveRetainRule+import Amazonka.DLM.Types.ArchiveRule+import Amazonka.DLM.Types.CreateRule+import Amazonka.DLM.Types.CrossRegionCopyAction+import Amazonka.DLM.Types.CrossRegionCopyDeprecateRule+import Amazonka.DLM.Types.CrossRegionCopyRetainRule+import Amazonka.DLM.Types.CrossRegionCopyRule+import Amazonka.DLM.Types.DeprecateRule+import Amazonka.DLM.Types.EncryptionConfiguration+import Amazonka.DLM.Types.EventParameters+import Amazonka.DLM.Types.EventSource+import Amazonka.DLM.Types.FastRestoreRule+import Amazonka.DLM.Types.LifecyclePolicy+import Amazonka.DLM.Types.LifecyclePolicySummary+import Amazonka.DLM.Types.Parameters+import Amazonka.DLM.Types.PolicyDetails+import Amazonka.DLM.Types.RetainRule+import Amazonka.DLM.Types.RetentionArchiveTier+import Amazonka.DLM.Types.Schedule+import Amazonka.DLM.Types.ShareRule+import Amazonka.DLM.Types.Tag+import Amazonka.DLM.UntagResource+import Amazonka.DLM.UpdateLifecyclePolicy
+ gen/Amazonka/DLM/ListTagsForResource.hs view
@@ -0,0 +1,159 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.ListTagsForResource+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists the tags for the specified resource.+module Amazonka.DLM.ListTagsForResource+ ( -- * Creating a Request+ ListTagsForResource (..),+ newListTagsForResource,++ -- * Request Lenses+ listTagsForResource_resourceArn,++ -- * Destructuring the Response+ ListTagsForResourceResponse (..),+ newListTagsForResourceResponse,++ -- * Response Lenses+ listTagsForResourceResponse_tags,+ listTagsForResourceResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newListTagsForResource' smart constructor.+data ListTagsForResource = ListTagsForResource'+ { -- | The Amazon Resource Name (ARN) of the resource.+ resourceArn :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListTagsForResource' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'resourceArn', 'listTagsForResource_resourceArn' - The Amazon Resource Name (ARN) of the resource.+newListTagsForResource ::+ -- | 'resourceArn'+ Prelude.Text ->+ ListTagsForResource+newListTagsForResource pResourceArn_ =+ ListTagsForResource' {resourceArn = pResourceArn_}++-- | The Amazon Resource Name (ARN) of the resource.+listTagsForResource_resourceArn :: Lens.Lens' ListTagsForResource Prelude.Text+listTagsForResource_resourceArn = Lens.lens (\ListTagsForResource' {resourceArn} -> resourceArn) (\s@ListTagsForResource' {} a -> s {resourceArn = a} :: ListTagsForResource)++instance Core.AWSRequest ListTagsForResource where+ type+ AWSResponse ListTagsForResource =+ ListTagsForResourceResponse+ request overrides =+ Request.get (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ ListTagsForResourceResponse'+ Prelude.<$> (x Data..?> "Tags" Core..!@ Prelude.mempty)+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable ListTagsForResource where+ hashWithSalt _salt ListTagsForResource' {..} =+ _salt `Prelude.hashWithSalt` resourceArn++instance Prelude.NFData ListTagsForResource where+ rnf ListTagsForResource' {..} =+ Prelude.rnf resourceArn++instance Data.ToHeaders ListTagsForResource where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToPath ListTagsForResource where+ toPath ListTagsForResource' {..} =+ Prelude.mconcat ["/tags/", Data.toBS resourceArn]++instance Data.ToQuery ListTagsForResource where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newListTagsForResourceResponse' smart constructor.+data ListTagsForResourceResponse = ListTagsForResourceResponse'+ { -- | Information about the tags.+ tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),+ -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListTagsForResourceResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'tags', 'listTagsForResourceResponse_tags' - Information about the tags.+--+-- 'httpStatus', 'listTagsForResourceResponse_httpStatus' - The response's http status code.+newListTagsForResourceResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ ListTagsForResourceResponse+newListTagsForResourceResponse pHttpStatus_ =+ ListTagsForResourceResponse'+ { tags =+ Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | Information about the tags.+listTagsForResourceResponse_tags :: Lens.Lens' ListTagsForResourceResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))+listTagsForResourceResponse_tags = Lens.lens (\ListTagsForResourceResponse' {tags} -> tags) (\s@ListTagsForResourceResponse' {} a -> s {tags = a} :: ListTagsForResourceResponse) Prelude.. Lens.mapping Lens.coerced++-- | The response's http status code.+listTagsForResourceResponse_httpStatus :: Lens.Lens' ListTagsForResourceResponse Prelude.Int+listTagsForResourceResponse_httpStatus = Lens.lens (\ListTagsForResourceResponse' {httpStatus} -> httpStatus) (\s@ListTagsForResourceResponse' {} a -> s {httpStatus = a} :: ListTagsForResourceResponse)++instance Prelude.NFData ListTagsForResourceResponse where+ rnf ListTagsForResourceResponse' {..} =+ Prelude.rnf tags+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/DLM/TagResource.hs view
@@ -0,0 +1,163 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.TagResource+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Adds the specified tags to the specified resource.+module Amazonka.DLM.TagResource+ ( -- * Creating a Request+ TagResource (..),+ newTagResource,++ -- * Request Lenses+ tagResource_resourceArn,+ tagResource_tags,++ -- * Destructuring the Response+ TagResourceResponse (..),+ newTagResourceResponse,++ -- * Response Lenses+ tagResourceResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newTagResource' smart constructor.+data TagResource = TagResource'+ { -- | The Amazon Resource Name (ARN) of the resource.+ resourceArn :: Prelude.Text,+ -- | One or more tags.+ tags :: Prelude.HashMap Prelude.Text Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'TagResource' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'resourceArn', 'tagResource_resourceArn' - The Amazon Resource Name (ARN) of the resource.+--+-- 'tags', 'tagResource_tags' - One or more tags.+newTagResource ::+ -- | 'resourceArn'+ Prelude.Text ->+ TagResource+newTagResource pResourceArn_ =+ TagResource'+ { resourceArn = pResourceArn_,+ tags = Prelude.mempty+ }++-- | The Amazon Resource Name (ARN) of the resource.+tagResource_resourceArn :: Lens.Lens' TagResource Prelude.Text+tagResource_resourceArn = Lens.lens (\TagResource' {resourceArn} -> resourceArn) (\s@TagResource' {} a -> s {resourceArn = a} :: TagResource)++-- | One or more tags.+tagResource_tags :: Lens.Lens' TagResource (Prelude.HashMap Prelude.Text Prelude.Text)+tagResource_tags = Lens.lens (\TagResource' {tags} -> tags) (\s@TagResource' {} a -> s {tags = a} :: TagResource) Prelude.. Lens.coerced++instance Core.AWSRequest TagResource where+ type AWSResponse TagResource = TagResourceResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveEmpty+ ( \s h x ->+ TagResourceResponse'+ Prelude.<$> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable TagResource where+ hashWithSalt _salt TagResource' {..} =+ _salt+ `Prelude.hashWithSalt` resourceArn+ `Prelude.hashWithSalt` tags++instance Prelude.NFData TagResource where+ rnf TagResource' {..} =+ Prelude.rnf resourceArn+ `Prelude.seq` Prelude.rnf tags++instance Data.ToHeaders TagResource where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON TagResource where+ toJSON TagResource' {..} =+ Data.object+ ( Prelude.catMaybes+ [Prelude.Just ("Tags" Data..= tags)]+ )++instance Data.ToPath TagResource where+ toPath TagResource' {..} =+ Prelude.mconcat ["/tags/", Data.toBS resourceArn]++instance Data.ToQuery TagResource where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newTagResourceResponse' smart constructor.+data TagResourceResponse = TagResourceResponse'+ { -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'TagResourceResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'httpStatus', 'tagResourceResponse_httpStatus' - The response's http status code.+newTagResourceResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ TagResourceResponse+newTagResourceResponse pHttpStatus_ =+ TagResourceResponse' {httpStatus = pHttpStatus_}++-- | The response's http status code.+tagResourceResponse_httpStatus :: Lens.Lens' TagResourceResponse Prelude.Int+tagResourceResponse_httpStatus = Lens.lens (\TagResourceResponse' {httpStatus} -> httpStatus) (\s@TagResourceResponse' {} a -> s {httpStatus = a} :: TagResourceResponse)++instance Prelude.NFData TagResourceResponse where+ rnf TagResourceResponse' {..} = Prelude.rnf httpStatus
+ gen/Amazonka/DLM/Types.hs view
@@ -0,0 +1,369 @@+{-# LANGUAGE DisambiguateRecordFields #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types+ ( -- * Service Configuration+ defaultService,++ -- * Errors+ _InternalServerException,+ _InvalidRequestException,+ _LimitExceededException,+ _ResourceNotFoundException,++ -- * EventSourceValues+ EventSourceValues (..),++ -- * EventTypeValues+ EventTypeValues (..),++ -- * GettablePolicyStateValues+ GettablePolicyStateValues (..),++ -- * IntervalUnitValues+ IntervalUnitValues (..),++ -- * LocationValues+ LocationValues (..),++ -- * PolicyTypeValues+ PolicyTypeValues (..),++ -- * ResourceLocationValues+ ResourceLocationValues (..),++ -- * ResourceTypeValues+ ResourceTypeValues (..),++ -- * RetentionIntervalUnitValues+ RetentionIntervalUnitValues (..),++ -- * SettablePolicyStateValues+ SettablePolicyStateValues (..),++ -- * Action+ Action (..),+ newAction,+ action_name,+ action_crossRegionCopy,++ -- * ArchiveRetainRule+ ArchiveRetainRule (..),+ newArchiveRetainRule,+ archiveRetainRule_retentionArchiveTier,++ -- * ArchiveRule+ ArchiveRule (..),+ newArchiveRule,+ archiveRule_retainRule,++ -- * CreateRule+ CreateRule (..),+ newCreateRule,+ createRule_cronExpression,+ createRule_interval,+ createRule_intervalUnit,+ createRule_location,+ createRule_times,++ -- * CrossRegionCopyAction+ CrossRegionCopyAction (..),+ newCrossRegionCopyAction,+ crossRegionCopyAction_retainRule,+ crossRegionCopyAction_target,+ crossRegionCopyAction_encryptionConfiguration,++ -- * CrossRegionCopyDeprecateRule+ CrossRegionCopyDeprecateRule (..),+ newCrossRegionCopyDeprecateRule,+ crossRegionCopyDeprecateRule_interval,+ crossRegionCopyDeprecateRule_intervalUnit,++ -- * CrossRegionCopyRetainRule+ CrossRegionCopyRetainRule (..),+ newCrossRegionCopyRetainRule,+ crossRegionCopyRetainRule_interval,+ crossRegionCopyRetainRule_intervalUnit,++ -- * CrossRegionCopyRule+ CrossRegionCopyRule (..),+ newCrossRegionCopyRule,+ crossRegionCopyRule_cmkArn,+ crossRegionCopyRule_copyTags,+ crossRegionCopyRule_deprecateRule,+ crossRegionCopyRule_retainRule,+ crossRegionCopyRule_target,+ crossRegionCopyRule_targetRegion,+ crossRegionCopyRule_encrypted,++ -- * DeprecateRule+ DeprecateRule (..),+ newDeprecateRule,+ deprecateRule_count,+ deprecateRule_interval,+ deprecateRule_intervalUnit,++ -- * EncryptionConfiguration+ EncryptionConfiguration (..),+ newEncryptionConfiguration,+ encryptionConfiguration_cmkArn,+ encryptionConfiguration_encrypted,++ -- * EventParameters+ EventParameters (..),+ newEventParameters,+ eventParameters_eventType,+ eventParameters_snapshotOwner,+ eventParameters_descriptionRegex,++ -- * EventSource+ EventSource (..),+ newEventSource,+ eventSource_parameters,+ eventSource_type,++ -- * FastRestoreRule+ FastRestoreRule (..),+ newFastRestoreRule,+ fastRestoreRule_count,+ fastRestoreRule_interval,+ fastRestoreRule_intervalUnit,+ fastRestoreRule_availabilityZones,++ -- * LifecyclePolicy+ LifecyclePolicy (..),+ newLifecyclePolicy,+ lifecyclePolicy_dateCreated,+ lifecyclePolicy_dateModified,+ lifecyclePolicy_description,+ lifecyclePolicy_executionRoleArn,+ lifecyclePolicy_policyArn,+ lifecyclePolicy_policyDetails,+ lifecyclePolicy_policyId,+ lifecyclePolicy_state,+ lifecyclePolicy_statusMessage,+ lifecyclePolicy_tags,++ -- * LifecyclePolicySummary+ LifecyclePolicySummary (..),+ newLifecyclePolicySummary,+ lifecyclePolicySummary_description,+ lifecyclePolicySummary_policyId,+ lifecyclePolicySummary_policyType,+ lifecyclePolicySummary_state,+ lifecyclePolicySummary_tags,++ -- * Parameters+ Parameters (..),+ newParameters,+ parameters_excludeBootVolume,+ parameters_excludeDataVolumeTags,+ parameters_noReboot,++ -- * PolicyDetails+ PolicyDetails (..),+ newPolicyDetails,+ policyDetails_actions,+ policyDetails_eventSource,+ policyDetails_parameters,+ policyDetails_policyType,+ policyDetails_resourceLocations,+ policyDetails_resourceTypes,+ policyDetails_schedules,+ policyDetails_targetTags,++ -- * RetainRule+ RetainRule (..),+ newRetainRule,+ retainRule_count,+ retainRule_interval,+ retainRule_intervalUnit,++ -- * RetentionArchiveTier+ RetentionArchiveTier (..),+ newRetentionArchiveTier,+ retentionArchiveTier_count,+ retentionArchiveTier_interval,+ retentionArchiveTier_intervalUnit,++ -- * Schedule+ Schedule (..),+ newSchedule,+ schedule_archiveRule,+ schedule_copyTags,+ schedule_createRule,+ schedule_crossRegionCopyRules,+ schedule_deprecateRule,+ schedule_fastRestoreRule,+ schedule_name,+ schedule_retainRule,+ schedule_shareRules,+ schedule_tagsToAdd,+ schedule_variableTags,++ -- * ShareRule+ ShareRule (..),+ newShareRule,+ shareRule_unshareInterval,+ shareRule_unshareIntervalUnit,+ shareRule_targetAccounts,++ -- * Tag+ Tag (..),+ newTag,+ tag_key,+ tag_value,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.Action+import Amazonka.DLM.Types.ArchiveRetainRule+import Amazonka.DLM.Types.ArchiveRule+import Amazonka.DLM.Types.CreateRule+import Amazonka.DLM.Types.CrossRegionCopyAction+import Amazonka.DLM.Types.CrossRegionCopyDeprecateRule+import Amazonka.DLM.Types.CrossRegionCopyRetainRule+import Amazonka.DLM.Types.CrossRegionCopyRule+import Amazonka.DLM.Types.DeprecateRule+import Amazonka.DLM.Types.EncryptionConfiguration+import Amazonka.DLM.Types.EventParameters+import Amazonka.DLM.Types.EventSource+import Amazonka.DLM.Types.EventSourceValues+import Amazonka.DLM.Types.EventTypeValues+import Amazonka.DLM.Types.FastRestoreRule+import Amazonka.DLM.Types.GettablePolicyStateValues+import Amazonka.DLM.Types.IntervalUnitValues+import Amazonka.DLM.Types.LifecyclePolicy+import Amazonka.DLM.Types.LifecyclePolicySummary+import Amazonka.DLM.Types.LocationValues+import Amazonka.DLM.Types.Parameters+import Amazonka.DLM.Types.PolicyDetails+import Amazonka.DLM.Types.PolicyTypeValues+import Amazonka.DLM.Types.ResourceLocationValues+import Amazonka.DLM.Types.ResourceTypeValues+import Amazonka.DLM.Types.RetainRule+import Amazonka.DLM.Types.RetentionArchiveTier+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import Amazonka.DLM.Types.Schedule+import Amazonka.DLM.Types.SettablePolicyStateValues+import Amazonka.DLM.Types.ShareRule+import Amazonka.DLM.Types.Tag+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Sign.V4 as Sign++-- | API version @2018-01-12@ of the Amazon Data Lifecycle Manager SDK configuration.+defaultService :: Core.Service+defaultService =+ Core.Service+ { Core.abbrev = "DLM",+ Core.signer = Sign.v4,+ Core.endpointPrefix = "dlm",+ Core.signingName = "dlm",+ Core.version = "2018-01-12",+ Core.s3AddressingStyle = Core.S3AddressingStyleAuto,+ Core.endpoint = Core.defaultEndpoint defaultService,+ Core.timeout = Prelude.Just 70,+ Core.check = Core.statusSuccess,+ Core.error = Core.parseJSONError "DLM",+ Core.retry = retry+ }+ where+ retry =+ Core.Exponential+ { Core.base = 5.0e-2,+ Core.growth = 2,+ Core.attempts = 5,+ Core.check = check+ }+ check e+ | Lens.has (Core.hasStatus 502) e =+ Prelude.Just "bad_gateway"+ | Lens.has (Core.hasStatus 504) e =+ Prelude.Just "gateway_timeout"+ | Lens.has (Core.hasStatus 500) e =+ Prelude.Just "general_server_error"+ | Lens.has (Core.hasStatus 509) e =+ Prelude.Just "limit_exceeded"+ | Lens.has+ ( Core.hasCode "RequestThrottledException"+ Prelude.. Core.hasStatus 400+ )+ e =+ Prelude.Just "request_throttled_exception"+ | Lens.has (Core.hasStatus 503) e =+ Prelude.Just "service_unavailable"+ | Lens.has+ ( Core.hasCode "ThrottledException"+ Prelude.. Core.hasStatus 400+ )+ e =+ Prelude.Just "throttled_exception"+ | Lens.has+ ( Core.hasCode "Throttling"+ Prelude.. Core.hasStatus 400+ )+ e =+ Prelude.Just "throttling"+ | Lens.has+ ( Core.hasCode "ThrottlingException"+ Prelude.. Core.hasStatus 400+ )+ e =+ Prelude.Just "throttling_exception"+ | Lens.has+ ( Core.hasCode+ "ProvisionedThroughputExceededException"+ Prelude.. Core.hasStatus 400+ )+ e =+ Prelude.Just "throughput_exceeded"+ | Lens.has (Core.hasStatus 429) e =+ Prelude.Just "too_many_requests"+ | Prelude.otherwise = Prelude.Nothing++-- | The service failed in an unexpected way.+_InternalServerException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_InternalServerException =+ Core._MatchServiceError+ defaultService+ "InternalServerException"+ Prelude.. Core.hasStatus 500++-- | Bad request. The request is missing required parameters or has invalid+-- parameters.+_InvalidRequestException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_InvalidRequestException =+ Core._MatchServiceError+ defaultService+ "InvalidRequestException"+ Prelude.. Core.hasStatus 400++-- | The request failed because a limit was exceeded.+_LimitExceededException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_LimitExceededException =+ Core._MatchServiceError+ defaultService+ "LimitExceededException"+ Prelude.. Core.hasStatus 429++-- | A requested resource was not found.+_ResourceNotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_ResourceNotFoundException =+ Core._MatchServiceError+ defaultService+ "ResourceNotFoundException"+ Prelude.. Core.hasStatus 404
+ gen/Amazonka/DLM/Types/Action.hs view
@@ -0,0 +1,101 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.Action+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.Action where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.CrossRegionCopyAction+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Event-based policies only]__ Specifies an action for an event-based+-- policy.+--+-- /See:/ 'newAction' smart constructor.+data Action = Action'+ { -- | A descriptive name for the action.+ name :: Prelude.Text,+ -- | The rule for copying shared snapshots across Regions.+ crossRegionCopy :: [CrossRegionCopyAction]+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'Action' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'name', 'action_name' - A descriptive name for the action.+--+-- 'crossRegionCopy', 'action_crossRegionCopy' - The rule for copying shared snapshots across Regions.+newAction ::+ -- | 'name'+ Prelude.Text ->+ Action+newAction pName_ =+ Action'+ { name = pName_,+ crossRegionCopy = Prelude.mempty+ }++-- | A descriptive name for the action.+action_name :: Lens.Lens' Action Prelude.Text+action_name = Lens.lens (\Action' {name} -> name) (\s@Action' {} a -> s {name = a} :: Action)++-- | The rule for copying shared snapshots across Regions.+action_crossRegionCopy :: Lens.Lens' Action [CrossRegionCopyAction]+action_crossRegionCopy = Lens.lens (\Action' {crossRegionCopy} -> crossRegionCopy) (\s@Action' {} a -> s {crossRegionCopy = a} :: Action) Prelude.. Lens.coerced++instance Data.FromJSON Action where+ parseJSON =+ Data.withObject+ "Action"+ ( \x ->+ Action'+ Prelude.<$> (x Data..: "Name")+ Prelude.<*> ( x+ Data..:? "CrossRegionCopy"+ Data..!= Prelude.mempty+ )+ )++instance Prelude.Hashable Action where+ hashWithSalt _salt Action' {..} =+ _salt+ `Prelude.hashWithSalt` name+ `Prelude.hashWithSalt` crossRegionCopy++instance Prelude.NFData Action where+ rnf Action' {..} =+ Prelude.rnf name+ `Prelude.seq` Prelude.rnf crossRegionCopy++instance Data.ToJSON Action where+ toJSON Action' {..} =+ Data.object+ ( Prelude.catMaybes+ [ Prelude.Just ("Name" Data..= name),+ Prelude.Just+ ("CrossRegionCopy" Data..= crossRegionCopy)+ ]+ )
+ gen/Amazonka/DLM/Types/ArchiveRetainRule.hs view
@@ -0,0 +1,93 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.ArchiveRetainRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.ArchiveRetainRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionArchiveTier+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot policies only]__ Specifies information about the archive+-- storage tier retention period.+--+-- /See:/ 'newArchiveRetainRule' smart constructor.+data ArchiveRetainRule = ArchiveRetainRule'+ { -- | Information about retention period in the Amazon EBS Snapshots Archive.+ -- For more information, see+ -- <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/snapshot-archive.html Archive Amazon EBS snapshots>.+ retentionArchiveTier :: RetentionArchiveTier+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ArchiveRetainRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'retentionArchiveTier', 'archiveRetainRule_retentionArchiveTier' - Information about retention period in the Amazon EBS Snapshots Archive.+-- For more information, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/snapshot-archive.html Archive Amazon EBS snapshots>.+newArchiveRetainRule ::+ -- | 'retentionArchiveTier'+ RetentionArchiveTier ->+ ArchiveRetainRule+newArchiveRetainRule pRetentionArchiveTier_ =+ ArchiveRetainRule'+ { retentionArchiveTier =+ pRetentionArchiveTier_+ }++-- | Information about retention period in the Amazon EBS Snapshots Archive.+-- For more information, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/snapshot-archive.html Archive Amazon EBS snapshots>.+archiveRetainRule_retentionArchiveTier :: Lens.Lens' ArchiveRetainRule RetentionArchiveTier+archiveRetainRule_retentionArchiveTier = Lens.lens (\ArchiveRetainRule' {retentionArchiveTier} -> retentionArchiveTier) (\s@ArchiveRetainRule' {} a -> s {retentionArchiveTier = a} :: ArchiveRetainRule)++instance Data.FromJSON ArchiveRetainRule where+ parseJSON =+ Data.withObject+ "ArchiveRetainRule"+ ( \x ->+ ArchiveRetainRule'+ Prelude.<$> (x Data..: "RetentionArchiveTier")+ )++instance Prelude.Hashable ArchiveRetainRule where+ hashWithSalt _salt ArchiveRetainRule' {..} =+ _salt `Prelude.hashWithSalt` retentionArchiveTier++instance Prelude.NFData ArchiveRetainRule where+ rnf ArchiveRetainRule' {..} =+ Prelude.rnf retentionArchiveTier++instance Data.ToJSON ArchiveRetainRule where+ toJSON ArchiveRetainRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ Prelude.Just+ ( "RetentionArchiveTier"+ Data..= retentionArchiveTier+ )+ ]+ )
+ gen/Amazonka/DLM/Types/ArchiveRule.hs view
@@ -0,0 +1,78 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.ArchiveRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.ArchiveRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.ArchiveRetainRule+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot policies only]__ Specifies a snapshot archiving rule for a+-- schedule.+--+-- /See:/ 'newArchiveRule' smart constructor.+data ArchiveRule = ArchiveRule'+ { -- | Information about the retention period for the snapshot archiving rule.+ retainRule :: ArchiveRetainRule+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ArchiveRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'retainRule', 'archiveRule_retainRule' - Information about the retention period for the snapshot archiving rule.+newArchiveRule ::+ -- | 'retainRule'+ ArchiveRetainRule ->+ ArchiveRule+newArchiveRule pRetainRule_ =+ ArchiveRule' {retainRule = pRetainRule_}++-- | Information about the retention period for the snapshot archiving rule.+archiveRule_retainRule :: Lens.Lens' ArchiveRule ArchiveRetainRule+archiveRule_retainRule = Lens.lens (\ArchiveRule' {retainRule} -> retainRule) (\s@ArchiveRule' {} a -> s {retainRule = a} :: ArchiveRule)++instance Data.FromJSON ArchiveRule where+ parseJSON =+ Data.withObject+ "ArchiveRule"+ ( \x ->+ ArchiveRule' Prelude.<$> (x Data..: "RetainRule")+ )++instance Prelude.Hashable ArchiveRule where+ hashWithSalt _salt ArchiveRule' {..} =+ _salt `Prelude.hashWithSalt` retainRule++instance Prelude.NFData ArchiveRule where+ rnf ArchiveRule' {..} = Prelude.rnf retainRule++instance Data.ToJSON ArchiveRule where+ toJSON ArchiveRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [Prelude.Just ("RetainRule" Data..= retainRule)]+ )
+ gen/Amazonka/DLM/Types/CreateRule.hs view
@@ -0,0 +1,196 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.CreateRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.CreateRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.IntervalUnitValues+import Amazonka.DLM.Types.LocationValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot and AMI policies only]__ Specifies when the policy should+-- create snapshots or AMIs.+--+-- - You must specify either __CronExpression__, or __Interval__,+-- __IntervalUnit__, and __Times__.+--+-- - If you need to specify an ArchiveRule for the schedule, then you+-- must specify a creation frequency of at least 28 days.+--+-- /See:/ 'newCreateRule' smart constructor.+data CreateRule = CreateRule'+ { -- | The schedule, as a Cron expression. The schedule interval must be+ -- between 1 hour and 1 year. For more information, see+ -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions Cron expressions>+ -- in the /Amazon CloudWatch User Guide/.+ cronExpression :: Prelude.Maybe Prelude.Text,+ -- | The interval between snapshots. The supported values are 1, 2, 3, 4, 6,+ -- 8, 12, and 24.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The interval unit.+ intervalUnit :: Prelude.Maybe IntervalUnitValues,+ -- | __[Snapshot policies only]__ Specifies the destination for snapshots+ -- created by the policy. To create snapshots in the same Region as the+ -- source resource, specify @CLOUD@. To create snapshots on the same+ -- Outpost as the source resource, specify @OUTPOST_LOCAL@. If you omit+ -- this parameter, @CLOUD@ is used by default.+ --+ -- If the policy targets resources in an Amazon Web Services Region, then+ -- you must create snapshots in the same Region as the source resource. If+ -- the policy targets resources on an Outpost, then you can create+ -- snapshots on the same Outpost as the source resource, or in the Region+ -- of that Outpost.+ location :: Prelude.Maybe LocationValues,+ -- | The time, in UTC, to start the operation. The supported format is hh:mm.+ --+ -- The operation occurs within a one-hour window following the specified+ -- time. If you do not specify a time, Amazon Data Lifecycle Manager+ -- selects a time within the next 24 hours.+ times :: Prelude.Maybe [Prelude.Text]+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CreateRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'cronExpression', 'createRule_cronExpression' - The schedule, as a Cron expression. The schedule interval must be+-- between 1 hour and 1 year. For more information, see+-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions Cron expressions>+-- in the /Amazon CloudWatch User Guide/.+--+-- 'interval', 'createRule_interval' - The interval between snapshots. The supported values are 1, 2, 3, 4, 6,+-- 8, 12, and 24.+--+-- 'intervalUnit', 'createRule_intervalUnit' - The interval unit.+--+-- 'location', 'createRule_location' - __[Snapshot policies only]__ Specifies the destination for snapshots+-- created by the policy. To create snapshots in the same Region as the+-- source resource, specify @CLOUD@. To create snapshots on the same+-- Outpost as the source resource, specify @OUTPOST_LOCAL@. If you omit+-- this parameter, @CLOUD@ is used by default.+--+-- If the policy targets resources in an Amazon Web Services Region, then+-- you must create snapshots in the same Region as the source resource. If+-- the policy targets resources on an Outpost, then you can create+-- snapshots on the same Outpost as the source resource, or in the Region+-- of that Outpost.+--+-- 'times', 'createRule_times' - The time, in UTC, to start the operation. The supported format is hh:mm.+--+-- The operation occurs within a one-hour window following the specified+-- time. If you do not specify a time, Amazon Data Lifecycle Manager+-- selects a time within the next 24 hours.+newCreateRule ::+ CreateRule+newCreateRule =+ CreateRule'+ { cronExpression = Prelude.Nothing,+ interval = Prelude.Nothing,+ intervalUnit = Prelude.Nothing,+ location = Prelude.Nothing,+ times = Prelude.Nothing+ }++-- | The schedule, as a Cron expression. The schedule interval must be+-- between 1 hour and 1 year. For more information, see+-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions Cron expressions>+-- in the /Amazon CloudWatch User Guide/.+createRule_cronExpression :: Lens.Lens' CreateRule (Prelude.Maybe Prelude.Text)+createRule_cronExpression = Lens.lens (\CreateRule' {cronExpression} -> cronExpression) (\s@CreateRule' {} a -> s {cronExpression = a} :: CreateRule)++-- | The interval between snapshots. The supported values are 1, 2, 3, 4, 6,+-- 8, 12, and 24.+createRule_interval :: Lens.Lens' CreateRule (Prelude.Maybe Prelude.Natural)+createRule_interval = Lens.lens (\CreateRule' {interval} -> interval) (\s@CreateRule' {} a -> s {interval = a} :: CreateRule)++-- | The interval unit.+createRule_intervalUnit :: Lens.Lens' CreateRule (Prelude.Maybe IntervalUnitValues)+createRule_intervalUnit = Lens.lens (\CreateRule' {intervalUnit} -> intervalUnit) (\s@CreateRule' {} a -> s {intervalUnit = a} :: CreateRule)++-- | __[Snapshot policies only]__ Specifies the destination for snapshots+-- created by the policy. To create snapshots in the same Region as the+-- source resource, specify @CLOUD@. To create snapshots on the same+-- Outpost as the source resource, specify @OUTPOST_LOCAL@. If you omit+-- this parameter, @CLOUD@ is used by default.+--+-- If the policy targets resources in an Amazon Web Services Region, then+-- you must create snapshots in the same Region as the source resource. If+-- the policy targets resources on an Outpost, then you can create+-- snapshots on the same Outpost as the source resource, or in the Region+-- of that Outpost.+createRule_location :: Lens.Lens' CreateRule (Prelude.Maybe LocationValues)+createRule_location = Lens.lens (\CreateRule' {location} -> location) (\s@CreateRule' {} a -> s {location = a} :: CreateRule)++-- | The time, in UTC, to start the operation. The supported format is hh:mm.+--+-- The operation occurs within a one-hour window following the specified+-- time. If you do not specify a time, Amazon Data Lifecycle Manager+-- selects a time within the next 24 hours.+createRule_times :: Lens.Lens' CreateRule (Prelude.Maybe [Prelude.Text])+createRule_times = Lens.lens (\CreateRule' {times} -> times) (\s@CreateRule' {} a -> s {times = a} :: CreateRule) Prelude.. Lens.mapping Lens.coerced++instance Data.FromJSON CreateRule where+ parseJSON =+ Data.withObject+ "CreateRule"+ ( \x ->+ CreateRule'+ Prelude.<$> (x Data..:? "CronExpression")+ Prelude.<*> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ Prelude.<*> (x Data..:? "Location")+ Prelude.<*> (x Data..:? "Times" Data..!= Prelude.mempty)+ )++instance Prelude.Hashable CreateRule where+ hashWithSalt _salt CreateRule' {..} =+ _salt+ `Prelude.hashWithSalt` cronExpression+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit+ `Prelude.hashWithSalt` location+ `Prelude.hashWithSalt` times++instance Prelude.NFData CreateRule where+ rnf CreateRule' {..} =+ Prelude.rnf cronExpression+ `Prelude.seq` Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit+ `Prelude.seq` Prelude.rnf location+ `Prelude.seq` Prelude.rnf times++instance Data.ToJSON CreateRule where+ toJSON CreateRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("CronExpression" Data..=)+ Prelude.<$> cronExpression,+ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit,+ ("Location" Data..=) Prelude.<$> location,+ ("Times" Data..=) Prelude.<$> times+ ]+ )
+ gen/Amazonka/DLM/Types/CrossRegionCopyAction.hs view
@@ -0,0 +1,121 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.CrossRegionCopyAction+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.CrossRegionCopyAction where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.CrossRegionCopyRetainRule+import Amazonka.DLM.Types.EncryptionConfiguration+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Event-based policies only]__ Specifies a cross-Region copy action for+-- event-based policies.+--+-- To specify a cross-Region copy rule for snapshot and AMI policies, use+-- CrossRegionCopyRule.+--+-- /See:/ 'newCrossRegionCopyAction' smart constructor.+data CrossRegionCopyAction = CrossRegionCopyAction'+ { retainRule :: Prelude.Maybe CrossRegionCopyRetainRule,+ -- | The target Region.+ target :: Prelude.Text,+ -- | The encryption settings for the copied snapshot.+ encryptionConfiguration :: EncryptionConfiguration+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CrossRegionCopyAction' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'retainRule', 'crossRegionCopyAction_retainRule' - Undocumented member.+--+-- 'target', 'crossRegionCopyAction_target' - The target Region.+--+-- 'encryptionConfiguration', 'crossRegionCopyAction_encryptionConfiguration' - The encryption settings for the copied snapshot.+newCrossRegionCopyAction ::+ -- | 'target'+ Prelude.Text ->+ -- | 'encryptionConfiguration'+ EncryptionConfiguration ->+ CrossRegionCopyAction+newCrossRegionCopyAction+ pTarget_+ pEncryptionConfiguration_ =+ CrossRegionCopyAction'+ { retainRule =+ Prelude.Nothing,+ target = pTarget_,+ encryptionConfiguration = pEncryptionConfiguration_+ }++-- | Undocumented member.+crossRegionCopyAction_retainRule :: Lens.Lens' CrossRegionCopyAction (Prelude.Maybe CrossRegionCopyRetainRule)+crossRegionCopyAction_retainRule = Lens.lens (\CrossRegionCopyAction' {retainRule} -> retainRule) (\s@CrossRegionCopyAction' {} a -> s {retainRule = a} :: CrossRegionCopyAction)++-- | The target Region.+crossRegionCopyAction_target :: Lens.Lens' CrossRegionCopyAction Prelude.Text+crossRegionCopyAction_target = Lens.lens (\CrossRegionCopyAction' {target} -> target) (\s@CrossRegionCopyAction' {} a -> s {target = a} :: CrossRegionCopyAction)++-- | The encryption settings for the copied snapshot.+crossRegionCopyAction_encryptionConfiguration :: Lens.Lens' CrossRegionCopyAction EncryptionConfiguration+crossRegionCopyAction_encryptionConfiguration = Lens.lens (\CrossRegionCopyAction' {encryptionConfiguration} -> encryptionConfiguration) (\s@CrossRegionCopyAction' {} a -> s {encryptionConfiguration = a} :: CrossRegionCopyAction)++instance Data.FromJSON CrossRegionCopyAction where+ parseJSON =+ Data.withObject+ "CrossRegionCopyAction"+ ( \x ->+ CrossRegionCopyAction'+ Prelude.<$> (x Data..:? "RetainRule")+ Prelude.<*> (x Data..: "Target")+ Prelude.<*> (x Data..: "EncryptionConfiguration")+ )++instance Prelude.Hashable CrossRegionCopyAction where+ hashWithSalt _salt CrossRegionCopyAction' {..} =+ _salt+ `Prelude.hashWithSalt` retainRule+ `Prelude.hashWithSalt` target+ `Prelude.hashWithSalt` encryptionConfiguration++instance Prelude.NFData CrossRegionCopyAction where+ rnf CrossRegionCopyAction' {..} =+ Prelude.rnf retainRule+ `Prelude.seq` Prelude.rnf target+ `Prelude.seq` Prelude.rnf encryptionConfiguration++instance Data.ToJSON CrossRegionCopyAction where+ toJSON CrossRegionCopyAction' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("RetainRule" Data..=) Prelude.<$> retainRule,+ Prelude.Just ("Target" Data..= target),+ Prelude.Just+ ( "EncryptionConfiguration"+ Data..= encryptionConfiguration+ )+ ]+ )
+ gen/Amazonka/DLM/Types/CrossRegionCopyDeprecateRule.hs view
@@ -0,0 +1,114 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.CrossRegionCopyDeprecateRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.CrossRegionCopyDeprecateRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[AMI policies only]__ Specifies an AMI deprecation rule for+-- cross-Region AMI copies created by an AMI policy.+--+-- /See:/ 'newCrossRegionCopyDeprecateRule' smart constructor.+data CrossRegionCopyDeprecateRule = CrossRegionCopyDeprecateRule'+ { -- | The period after which to deprecate the cross-Region AMI copies. The+ -- period must be less than or equal to the cross-Region AMI copy retention+ -- period, and it can\'t be greater than 10 years. This is equivalent to+ -- 120 months, 520 weeks, or 3650 days.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time in which to measure the __Interval__. For example, to+ -- deprecate a cross-Region AMI copy after 3 months, specify @Interval=3@+ -- and @IntervalUnit=MONTHS@.+ intervalUnit :: Prelude.Maybe RetentionIntervalUnitValues+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CrossRegionCopyDeprecateRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'interval', 'crossRegionCopyDeprecateRule_interval' - The period after which to deprecate the cross-Region AMI copies. The+-- period must be less than or equal to the cross-Region AMI copy retention+-- period, and it can\'t be greater than 10 years. This is equivalent to+-- 120 months, 520 weeks, or 3650 days.+--+-- 'intervalUnit', 'crossRegionCopyDeprecateRule_intervalUnit' - The unit of time in which to measure the __Interval__. For example, to+-- deprecate a cross-Region AMI copy after 3 months, specify @Interval=3@+-- and @IntervalUnit=MONTHS@.+newCrossRegionCopyDeprecateRule ::+ CrossRegionCopyDeprecateRule+newCrossRegionCopyDeprecateRule =+ CrossRegionCopyDeprecateRule'+ { interval =+ Prelude.Nothing,+ intervalUnit = Prelude.Nothing+ }++-- | The period after which to deprecate the cross-Region AMI copies. The+-- period must be less than or equal to the cross-Region AMI copy retention+-- period, and it can\'t be greater than 10 years. This is equivalent to+-- 120 months, 520 weeks, or 3650 days.+crossRegionCopyDeprecateRule_interval :: Lens.Lens' CrossRegionCopyDeprecateRule (Prelude.Maybe Prelude.Natural)+crossRegionCopyDeprecateRule_interval = Lens.lens (\CrossRegionCopyDeprecateRule' {interval} -> interval) (\s@CrossRegionCopyDeprecateRule' {} a -> s {interval = a} :: CrossRegionCopyDeprecateRule)++-- | The unit of time in which to measure the __Interval__. For example, to+-- deprecate a cross-Region AMI copy after 3 months, specify @Interval=3@+-- and @IntervalUnit=MONTHS@.+crossRegionCopyDeprecateRule_intervalUnit :: Lens.Lens' CrossRegionCopyDeprecateRule (Prelude.Maybe RetentionIntervalUnitValues)+crossRegionCopyDeprecateRule_intervalUnit = Lens.lens (\CrossRegionCopyDeprecateRule' {intervalUnit} -> intervalUnit) (\s@CrossRegionCopyDeprecateRule' {} a -> s {intervalUnit = a} :: CrossRegionCopyDeprecateRule)++instance Data.FromJSON CrossRegionCopyDeprecateRule where+ parseJSON =+ Data.withObject+ "CrossRegionCopyDeprecateRule"+ ( \x ->+ CrossRegionCopyDeprecateRule'+ Prelude.<$> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ )++instance+ Prelude.Hashable+ CrossRegionCopyDeprecateRule+ where+ hashWithSalt _salt CrossRegionCopyDeprecateRule' {..} =+ _salt+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit++instance Prelude.NFData CrossRegionCopyDeprecateRule where+ rnf CrossRegionCopyDeprecateRule' {..} =+ Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit++instance Data.ToJSON CrossRegionCopyDeprecateRule where+ toJSON CrossRegionCopyDeprecateRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit+ ]+ )
+ gen/Amazonka/DLM/Types/CrossRegionCopyRetainRule.hs view
@@ -0,0 +1,110 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.CrossRegionCopyRetainRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.CrossRegionCopyRetainRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | Specifies a retention rule for cross-Region snapshot copies created by+-- snapshot or event-based policies, or cross-Region AMI copies created by+-- AMI policies. After the retention period expires, the cross-Region copy+-- is deleted.+--+-- /See:/ 'newCrossRegionCopyRetainRule' smart constructor.+data CrossRegionCopyRetainRule = CrossRegionCopyRetainRule'+ { -- | The amount of time to retain a cross-Region snapshot or AMI copy. The+ -- maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or+ -- 36500 days.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time for time-based retention. For example, to retain a+ -- cross-Region copy for 3 months, specify @Interval=3@ and+ -- @IntervalUnit=MONTHS@.+ intervalUnit :: Prelude.Maybe RetentionIntervalUnitValues+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CrossRegionCopyRetainRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'interval', 'crossRegionCopyRetainRule_interval' - The amount of time to retain a cross-Region snapshot or AMI copy. The+-- maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or+-- 36500 days.+--+-- 'intervalUnit', 'crossRegionCopyRetainRule_intervalUnit' - The unit of time for time-based retention. For example, to retain a+-- cross-Region copy for 3 months, specify @Interval=3@ and+-- @IntervalUnit=MONTHS@.+newCrossRegionCopyRetainRule ::+ CrossRegionCopyRetainRule+newCrossRegionCopyRetainRule =+ CrossRegionCopyRetainRule'+ { interval =+ Prelude.Nothing,+ intervalUnit = Prelude.Nothing+ }++-- | The amount of time to retain a cross-Region snapshot or AMI copy. The+-- maximum is 100 years. This is equivalent to 1200 months, 5200 weeks, or+-- 36500 days.+crossRegionCopyRetainRule_interval :: Lens.Lens' CrossRegionCopyRetainRule (Prelude.Maybe Prelude.Natural)+crossRegionCopyRetainRule_interval = Lens.lens (\CrossRegionCopyRetainRule' {interval} -> interval) (\s@CrossRegionCopyRetainRule' {} a -> s {interval = a} :: CrossRegionCopyRetainRule)++-- | The unit of time for time-based retention. For example, to retain a+-- cross-Region copy for 3 months, specify @Interval=3@ and+-- @IntervalUnit=MONTHS@.+crossRegionCopyRetainRule_intervalUnit :: Lens.Lens' CrossRegionCopyRetainRule (Prelude.Maybe RetentionIntervalUnitValues)+crossRegionCopyRetainRule_intervalUnit = Lens.lens (\CrossRegionCopyRetainRule' {intervalUnit} -> intervalUnit) (\s@CrossRegionCopyRetainRule' {} a -> s {intervalUnit = a} :: CrossRegionCopyRetainRule)++instance Data.FromJSON CrossRegionCopyRetainRule where+ parseJSON =+ Data.withObject+ "CrossRegionCopyRetainRule"+ ( \x ->+ CrossRegionCopyRetainRule'+ Prelude.<$> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ )++instance Prelude.Hashable CrossRegionCopyRetainRule where+ hashWithSalt _salt CrossRegionCopyRetainRule' {..} =+ _salt+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit++instance Prelude.NFData CrossRegionCopyRetainRule where+ rnf CrossRegionCopyRetainRule' {..} =+ Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit++instance Data.ToJSON CrossRegionCopyRetainRule where+ toJSON CrossRegionCopyRetainRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit+ ]+ )
+ gen/Amazonka/DLM/Types/CrossRegionCopyRule.hs view
@@ -0,0 +1,214 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.CrossRegionCopyRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.CrossRegionCopyRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.CrossRegionCopyDeprecateRule+import Amazonka.DLM.Types.CrossRegionCopyRetainRule+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot and AMI policies only]__ Specifies a cross-Region copy rule+-- for snapshot and AMI policies.+--+-- To specify a cross-Region copy action for event-based polices, use+-- CrossRegionCopyAction.+--+-- /See:/ 'newCrossRegionCopyRule' smart constructor.+data CrossRegionCopyRule = CrossRegionCopyRule'+ { -- | The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption.+ -- If this parameter is not specified, the default KMS key for the account+ -- is used.+ cmkArn :: Prelude.Maybe Prelude.Text,+ -- | Indicates whether to copy all user-defined tags from the source snapshot+ -- or AMI to the cross-Region copy.+ copyTags :: Prelude.Maybe Prelude.Bool,+ -- | __[AMI policies only]__ The AMI deprecation rule for cross-Region AMI+ -- copies created by the rule.+ deprecateRule :: Prelude.Maybe CrossRegionCopyDeprecateRule,+ -- | The retention rule that indicates how long the cross-Region snapshot or+ -- AMI copies are to be retained in the destination Region.+ retainRule :: Prelude.Maybe CrossRegionCopyRetainRule,+ -- | The target Region or the Amazon Resource Name (ARN) of the target+ -- Outpost for the snapshot copies.+ --+ -- Use this parameter instead of __TargetRegion__. Do not specify both.+ target :: Prelude.Maybe Prelude.Text,+ -- | Avoid using this parameter when creating new policies. Instead, use+ -- __Target__ to specify a target Region or a target Outpost for snapshot+ -- copies.+ --+ -- For policies created before the __Target__ parameter was introduced,+ -- this parameter indicates the target Region for snapshot copies.+ targetRegion :: Prelude.Maybe Prelude.Text,+ -- | To encrypt a copy of an unencrypted snapshot if encryption by default is+ -- not enabled, enable encryption using this parameter. Copies of encrypted+ -- snapshots are encrypted, even if this parameter is false or if+ -- encryption by default is not enabled.+ encrypted :: Prelude.Bool+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CrossRegionCopyRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'cmkArn', 'crossRegionCopyRule_cmkArn' - The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption.+-- If this parameter is not specified, the default KMS key for the account+-- is used.+--+-- 'copyTags', 'crossRegionCopyRule_copyTags' - Indicates whether to copy all user-defined tags from the source snapshot+-- or AMI to the cross-Region copy.+--+-- 'deprecateRule', 'crossRegionCopyRule_deprecateRule' - __[AMI policies only]__ The AMI deprecation rule for cross-Region AMI+-- copies created by the rule.+--+-- 'retainRule', 'crossRegionCopyRule_retainRule' - The retention rule that indicates how long the cross-Region snapshot or+-- AMI copies are to be retained in the destination Region.+--+-- 'target', 'crossRegionCopyRule_target' - The target Region or the Amazon Resource Name (ARN) of the target+-- Outpost for the snapshot copies.+--+-- Use this parameter instead of __TargetRegion__. Do not specify both.+--+-- 'targetRegion', 'crossRegionCopyRule_targetRegion' - Avoid using this parameter when creating new policies. Instead, use+-- __Target__ to specify a target Region or a target Outpost for snapshot+-- copies.+--+-- For policies created before the __Target__ parameter was introduced,+-- this parameter indicates the target Region for snapshot copies.+--+-- 'encrypted', 'crossRegionCopyRule_encrypted' - To encrypt a copy of an unencrypted snapshot if encryption by default is+-- not enabled, enable encryption using this parameter. Copies of encrypted+-- snapshots are encrypted, even if this parameter is false or if+-- encryption by default is not enabled.+newCrossRegionCopyRule ::+ -- | 'encrypted'+ Prelude.Bool ->+ CrossRegionCopyRule+newCrossRegionCopyRule pEncrypted_ =+ CrossRegionCopyRule'+ { cmkArn = Prelude.Nothing,+ copyTags = Prelude.Nothing,+ deprecateRule = Prelude.Nothing,+ retainRule = Prelude.Nothing,+ target = Prelude.Nothing,+ targetRegion = Prelude.Nothing,+ encrypted = pEncrypted_+ }++-- | The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption.+-- If this parameter is not specified, the default KMS key for the account+-- is used.+crossRegionCopyRule_cmkArn :: Lens.Lens' CrossRegionCopyRule (Prelude.Maybe Prelude.Text)+crossRegionCopyRule_cmkArn = Lens.lens (\CrossRegionCopyRule' {cmkArn} -> cmkArn) (\s@CrossRegionCopyRule' {} a -> s {cmkArn = a} :: CrossRegionCopyRule)++-- | Indicates whether to copy all user-defined tags from the source snapshot+-- or AMI to the cross-Region copy.+crossRegionCopyRule_copyTags :: Lens.Lens' CrossRegionCopyRule (Prelude.Maybe Prelude.Bool)+crossRegionCopyRule_copyTags = Lens.lens (\CrossRegionCopyRule' {copyTags} -> copyTags) (\s@CrossRegionCopyRule' {} a -> s {copyTags = a} :: CrossRegionCopyRule)++-- | __[AMI policies only]__ The AMI deprecation rule for cross-Region AMI+-- copies created by the rule.+crossRegionCopyRule_deprecateRule :: Lens.Lens' CrossRegionCopyRule (Prelude.Maybe CrossRegionCopyDeprecateRule)+crossRegionCopyRule_deprecateRule = Lens.lens (\CrossRegionCopyRule' {deprecateRule} -> deprecateRule) (\s@CrossRegionCopyRule' {} a -> s {deprecateRule = a} :: CrossRegionCopyRule)++-- | The retention rule that indicates how long the cross-Region snapshot or+-- AMI copies are to be retained in the destination Region.+crossRegionCopyRule_retainRule :: Lens.Lens' CrossRegionCopyRule (Prelude.Maybe CrossRegionCopyRetainRule)+crossRegionCopyRule_retainRule = Lens.lens (\CrossRegionCopyRule' {retainRule} -> retainRule) (\s@CrossRegionCopyRule' {} a -> s {retainRule = a} :: CrossRegionCopyRule)++-- | The target Region or the Amazon Resource Name (ARN) of the target+-- Outpost for the snapshot copies.+--+-- Use this parameter instead of __TargetRegion__. Do not specify both.+crossRegionCopyRule_target :: Lens.Lens' CrossRegionCopyRule (Prelude.Maybe Prelude.Text)+crossRegionCopyRule_target = Lens.lens (\CrossRegionCopyRule' {target} -> target) (\s@CrossRegionCopyRule' {} a -> s {target = a} :: CrossRegionCopyRule)++-- | Avoid using this parameter when creating new policies. Instead, use+-- __Target__ to specify a target Region or a target Outpost for snapshot+-- copies.+--+-- For policies created before the __Target__ parameter was introduced,+-- this parameter indicates the target Region for snapshot copies.+crossRegionCopyRule_targetRegion :: Lens.Lens' CrossRegionCopyRule (Prelude.Maybe Prelude.Text)+crossRegionCopyRule_targetRegion = Lens.lens (\CrossRegionCopyRule' {targetRegion} -> targetRegion) (\s@CrossRegionCopyRule' {} a -> s {targetRegion = a} :: CrossRegionCopyRule)++-- | To encrypt a copy of an unencrypted snapshot if encryption by default is+-- not enabled, enable encryption using this parameter. Copies of encrypted+-- snapshots are encrypted, even if this parameter is false or if+-- encryption by default is not enabled.+crossRegionCopyRule_encrypted :: Lens.Lens' CrossRegionCopyRule Prelude.Bool+crossRegionCopyRule_encrypted = Lens.lens (\CrossRegionCopyRule' {encrypted} -> encrypted) (\s@CrossRegionCopyRule' {} a -> s {encrypted = a} :: CrossRegionCopyRule)++instance Data.FromJSON CrossRegionCopyRule where+ parseJSON =+ Data.withObject+ "CrossRegionCopyRule"+ ( \x ->+ CrossRegionCopyRule'+ Prelude.<$> (x Data..:? "CmkArn")+ Prelude.<*> (x Data..:? "CopyTags")+ Prelude.<*> (x Data..:? "DeprecateRule")+ Prelude.<*> (x Data..:? "RetainRule")+ Prelude.<*> (x Data..:? "Target")+ Prelude.<*> (x Data..:? "TargetRegion")+ Prelude.<*> (x Data..: "Encrypted")+ )++instance Prelude.Hashable CrossRegionCopyRule where+ hashWithSalt _salt CrossRegionCopyRule' {..} =+ _salt+ `Prelude.hashWithSalt` cmkArn+ `Prelude.hashWithSalt` copyTags+ `Prelude.hashWithSalt` deprecateRule+ `Prelude.hashWithSalt` retainRule+ `Prelude.hashWithSalt` target+ `Prelude.hashWithSalt` targetRegion+ `Prelude.hashWithSalt` encrypted++instance Prelude.NFData CrossRegionCopyRule where+ rnf CrossRegionCopyRule' {..} =+ Prelude.rnf cmkArn+ `Prelude.seq` Prelude.rnf copyTags+ `Prelude.seq` Prelude.rnf deprecateRule+ `Prelude.seq` Prelude.rnf retainRule+ `Prelude.seq` Prelude.rnf target+ `Prelude.seq` Prelude.rnf targetRegion+ `Prelude.seq` Prelude.rnf encrypted++instance Data.ToJSON CrossRegionCopyRule where+ toJSON CrossRegionCopyRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("CmkArn" Data..=) Prelude.<$> cmkArn,+ ("CopyTags" Data..=) Prelude.<$> copyTags,+ ("DeprecateRule" Data..=) Prelude.<$> deprecateRule,+ ("RetainRule" Data..=) Prelude.<$> retainRule,+ ("Target" Data..=) Prelude.<$> target,+ ("TargetRegion" Data..=) Prelude.<$> targetRegion,+ Prelude.Just ("Encrypted" Data..= encrypted)+ ]+ )
+ gen/Amazonka/DLM/Types/DeprecateRule.hs view
@@ -0,0 +1,132 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.DeprecateRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.DeprecateRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[AMI policies only]__ Specifies an AMI deprecation rule for AMIs+-- created by an AMI lifecycle policy.+--+-- For age-based schedules, you must specify __Interval__ and+-- __IntervalUnit__. For count-based schedules, you must specify __Count__.+--+-- /See:/ 'newDeprecateRule' smart constructor.+data DeprecateRule = DeprecateRule'+ { -- | If the schedule has a count-based retention rule, this parameter+ -- specifies the number of oldest AMIs to deprecate. The count must be less+ -- than or equal to the schedule\'s retention count, and it can\'t be+ -- greater than 1000.+ count :: Prelude.Maybe Prelude.Natural,+ -- | If the schedule has an age-based retention rule, this parameter+ -- specifies the period after which to deprecate AMIs created by the+ -- schedule. The period must be less than or equal to the schedule\'s+ -- retention period, and it can\'t be greater than 10 years. This is+ -- equivalent to 120 months, 520 weeks, or 3650 days.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time in which to measure the __Interval__.+ intervalUnit :: Prelude.Maybe RetentionIntervalUnitValues+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'DeprecateRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'count', 'deprecateRule_count' - If the schedule has a count-based retention rule, this parameter+-- specifies the number of oldest AMIs to deprecate. The count must be less+-- than or equal to the schedule\'s retention count, and it can\'t be+-- greater than 1000.+--+-- 'interval', 'deprecateRule_interval' - If the schedule has an age-based retention rule, this parameter+-- specifies the period after which to deprecate AMIs created by the+-- schedule. The period must be less than or equal to the schedule\'s+-- retention period, and it can\'t be greater than 10 years. This is+-- equivalent to 120 months, 520 weeks, or 3650 days.+--+-- 'intervalUnit', 'deprecateRule_intervalUnit' - The unit of time in which to measure the __Interval__.+newDeprecateRule ::+ DeprecateRule+newDeprecateRule =+ DeprecateRule'+ { count = Prelude.Nothing,+ interval = Prelude.Nothing,+ intervalUnit = Prelude.Nothing+ }++-- | If the schedule has a count-based retention rule, this parameter+-- specifies the number of oldest AMIs to deprecate. The count must be less+-- than or equal to the schedule\'s retention count, and it can\'t be+-- greater than 1000.+deprecateRule_count :: Lens.Lens' DeprecateRule (Prelude.Maybe Prelude.Natural)+deprecateRule_count = Lens.lens (\DeprecateRule' {count} -> count) (\s@DeprecateRule' {} a -> s {count = a} :: DeprecateRule)++-- | If the schedule has an age-based retention rule, this parameter+-- specifies the period after which to deprecate AMIs created by the+-- schedule. The period must be less than or equal to the schedule\'s+-- retention period, and it can\'t be greater than 10 years. This is+-- equivalent to 120 months, 520 weeks, or 3650 days.+deprecateRule_interval :: Lens.Lens' DeprecateRule (Prelude.Maybe Prelude.Natural)+deprecateRule_interval = Lens.lens (\DeprecateRule' {interval} -> interval) (\s@DeprecateRule' {} a -> s {interval = a} :: DeprecateRule)++-- | The unit of time in which to measure the __Interval__.+deprecateRule_intervalUnit :: Lens.Lens' DeprecateRule (Prelude.Maybe RetentionIntervalUnitValues)+deprecateRule_intervalUnit = Lens.lens (\DeprecateRule' {intervalUnit} -> intervalUnit) (\s@DeprecateRule' {} a -> s {intervalUnit = a} :: DeprecateRule)++instance Data.FromJSON DeprecateRule where+ parseJSON =+ Data.withObject+ "DeprecateRule"+ ( \x ->+ DeprecateRule'+ Prelude.<$> (x Data..:? "Count")+ Prelude.<*> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ )++instance Prelude.Hashable DeprecateRule where+ hashWithSalt _salt DeprecateRule' {..} =+ _salt+ `Prelude.hashWithSalt` count+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit++instance Prelude.NFData DeprecateRule where+ rnf DeprecateRule' {..} =+ Prelude.rnf count+ `Prelude.seq` Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit++instance Data.ToJSON DeprecateRule where+ toJSON DeprecateRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Count" Data..=) Prelude.<$> count,+ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit+ ]+ )
+ gen/Amazonka/DLM/Types/EncryptionConfiguration.hs view
@@ -0,0 +1,111 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.EncryptionConfiguration+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.EncryptionConfiguration where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Event-based policies only]__ Specifies the encryption settings for+-- cross-Region snapshot copies created by event-based policies.+--+-- /See:/ 'newEncryptionConfiguration' smart constructor.+data EncryptionConfiguration = EncryptionConfiguration'+ { -- | The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption.+ -- If this parameter is not specified, the default KMS key for the account+ -- is used.+ cmkArn :: Prelude.Maybe Prelude.Text,+ -- | To encrypt a copy of an unencrypted snapshot when encryption by default+ -- is not enabled, enable encryption using this parameter. Copies of+ -- encrypted snapshots are encrypted, even if this parameter is false or+ -- when encryption by default is not enabled.+ encrypted :: Prelude.Bool+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'EncryptionConfiguration' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'cmkArn', 'encryptionConfiguration_cmkArn' - The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption.+-- If this parameter is not specified, the default KMS key for the account+-- is used.+--+-- 'encrypted', 'encryptionConfiguration_encrypted' - To encrypt a copy of an unencrypted snapshot when encryption by default+-- is not enabled, enable encryption using this parameter. Copies of+-- encrypted snapshots are encrypted, even if this parameter is false or+-- when encryption by default is not enabled.+newEncryptionConfiguration ::+ -- | 'encrypted'+ Prelude.Bool ->+ EncryptionConfiguration+newEncryptionConfiguration pEncrypted_ =+ EncryptionConfiguration'+ { cmkArn = Prelude.Nothing,+ encrypted = pEncrypted_+ }++-- | The Amazon Resource Name (ARN) of the KMS key to use for EBS encryption.+-- If this parameter is not specified, the default KMS key for the account+-- is used.+encryptionConfiguration_cmkArn :: Lens.Lens' EncryptionConfiguration (Prelude.Maybe Prelude.Text)+encryptionConfiguration_cmkArn = Lens.lens (\EncryptionConfiguration' {cmkArn} -> cmkArn) (\s@EncryptionConfiguration' {} a -> s {cmkArn = a} :: EncryptionConfiguration)++-- | To encrypt a copy of an unencrypted snapshot when encryption by default+-- is not enabled, enable encryption using this parameter. Copies of+-- encrypted snapshots are encrypted, even if this parameter is false or+-- when encryption by default is not enabled.+encryptionConfiguration_encrypted :: Lens.Lens' EncryptionConfiguration Prelude.Bool+encryptionConfiguration_encrypted = Lens.lens (\EncryptionConfiguration' {encrypted} -> encrypted) (\s@EncryptionConfiguration' {} a -> s {encrypted = a} :: EncryptionConfiguration)++instance Data.FromJSON EncryptionConfiguration where+ parseJSON =+ Data.withObject+ "EncryptionConfiguration"+ ( \x ->+ EncryptionConfiguration'+ Prelude.<$> (x Data..:? "CmkArn")+ Prelude.<*> (x Data..: "Encrypted")+ )++instance Prelude.Hashable EncryptionConfiguration where+ hashWithSalt _salt EncryptionConfiguration' {..} =+ _salt+ `Prelude.hashWithSalt` cmkArn+ `Prelude.hashWithSalt` encrypted++instance Prelude.NFData EncryptionConfiguration where+ rnf EncryptionConfiguration' {..} =+ Prelude.rnf cmkArn+ `Prelude.seq` Prelude.rnf encrypted++instance Data.ToJSON EncryptionConfiguration where+ toJSON EncryptionConfiguration' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("CmkArn" Data..=) Prelude.<$> cmkArn,+ Prelude.Just ("Encrypted" Data..= encrypted)+ ]+ )
+ gen/Amazonka/DLM/Types/EventParameters.hs view
@@ -0,0 +1,149 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.EventParameters+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.EventParameters where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.EventTypeValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Event-based policies only]__ Specifies an event that activates an+-- event-based policy.+--+-- /See:/ 'newEventParameters' smart constructor.+data EventParameters = EventParameters'+ { -- | The type of event. Currently, only snapshot sharing events are+ -- supported.+ eventType :: EventTypeValues,+ -- | The IDs of the Amazon Web Services accounts that can trigger policy by+ -- sharing snapshots with your account. The policy only runs if one of the+ -- specified Amazon Web Services accounts shares a snapshot with your+ -- account.+ snapshotOwner :: [Prelude.Text],+ -- | The snapshot description that can trigger the policy. The description+ -- pattern is specified using a regular expression. The policy runs only if+ -- a snapshot with a description that matches the specified pattern is+ -- shared with your account.+ --+ -- For example, specifying+ -- @^.*Created for policy: policy-1234567890abcdef0.*$@ configures the+ -- policy to run only if snapshots created by policy+ -- @policy-1234567890abcdef0@ are shared with your account.+ descriptionRegex :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'EventParameters' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'eventType', 'eventParameters_eventType' - The type of event. Currently, only snapshot sharing events are+-- supported.+--+-- 'snapshotOwner', 'eventParameters_snapshotOwner' - The IDs of the Amazon Web Services accounts that can trigger policy by+-- sharing snapshots with your account. The policy only runs if one of the+-- specified Amazon Web Services accounts shares a snapshot with your+-- account.+--+-- 'descriptionRegex', 'eventParameters_descriptionRegex' - The snapshot description that can trigger the policy. The description+-- pattern is specified using a regular expression. The policy runs only if+-- a snapshot with a description that matches the specified pattern is+-- shared with your account.+--+-- For example, specifying+-- @^.*Created for policy: policy-1234567890abcdef0.*$@ configures the+-- policy to run only if snapshots created by policy+-- @policy-1234567890abcdef0@ are shared with your account.+newEventParameters ::+ -- | 'eventType'+ EventTypeValues ->+ -- | 'descriptionRegex'+ Prelude.Text ->+ EventParameters+newEventParameters pEventType_ pDescriptionRegex_ =+ EventParameters'+ { eventType = pEventType_,+ snapshotOwner = Prelude.mempty,+ descriptionRegex = pDescriptionRegex_+ }++-- | The type of event. Currently, only snapshot sharing events are+-- supported.+eventParameters_eventType :: Lens.Lens' EventParameters EventTypeValues+eventParameters_eventType = Lens.lens (\EventParameters' {eventType} -> eventType) (\s@EventParameters' {} a -> s {eventType = a} :: EventParameters)++-- | The IDs of the Amazon Web Services accounts that can trigger policy by+-- sharing snapshots with your account. The policy only runs if one of the+-- specified Amazon Web Services accounts shares a snapshot with your+-- account.+eventParameters_snapshotOwner :: Lens.Lens' EventParameters [Prelude.Text]+eventParameters_snapshotOwner = Lens.lens (\EventParameters' {snapshotOwner} -> snapshotOwner) (\s@EventParameters' {} a -> s {snapshotOwner = a} :: EventParameters) Prelude.. Lens.coerced++-- | The snapshot description that can trigger the policy. The description+-- pattern is specified using a regular expression. The policy runs only if+-- a snapshot with a description that matches the specified pattern is+-- shared with your account.+--+-- For example, specifying+-- @^.*Created for policy: policy-1234567890abcdef0.*$@ configures the+-- policy to run only if snapshots created by policy+-- @policy-1234567890abcdef0@ are shared with your account.+eventParameters_descriptionRegex :: Lens.Lens' EventParameters Prelude.Text+eventParameters_descriptionRegex = Lens.lens (\EventParameters' {descriptionRegex} -> descriptionRegex) (\s@EventParameters' {} a -> s {descriptionRegex = a} :: EventParameters)++instance Data.FromJSON EventParameters where+ parseJSON =+ Data.withObject+ "EventParameters"+ ( \x ->+ EventParameters'+ Prelude.<$> (x Data..: "EventType")+ Prelude.<*> (x Data..:? "SnapshotOwner" Data..!= Prelude.mempty)+ Prelude.<*> (x Data..: "DescriptionRegex")+ )++instance Prelude.Hashable EventParameters where+ hashWithSalt _salt EventParameters' {..} =+ _salt+ `Prelude.hashWithSalt` eventType+ `Prelude.hashWithSalt` snapshotOwner+ `Prelude.hashWithSalt` descriptionRegex++instance Prelude.NFData EventParameters where+ rnf EventParameters' {..} =+ Prelude.rnf eventType+ `Prelude.seq` Prelude.rnf snapshotOwner+ `Prelude.seq` Prelude.rnf descriptionRegex++instance Data.ToJSON EventParameters where+ toJSON EventParameters' {..} =+ Data.object+ ( Prelude.catMaybes+ [ Prelude.Just ("EventType" Data..= eventType),+ Prelude.Just ("SnapshotOwner" Data..= snapshotOwner),+ Prelude.Just+ ("DescriptionRegex" Data..= descriptionRegex)+ ]+ )
+ gen/Amazonka/DLM/Types/EventSource.hs view
@@ -0,0 +1,101 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.EventSource+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.EventSource where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.EventParameters+import Amazonka.DLM.Types.EventSourceValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Event-based policies only]__ Specifies an event that activates an+-- event-based policy.+--+-- /See:/ 'newEventSource' smart constructor.+data EventSource = EventSource'+ { -- | Information about the event.+ parameters :: Prelude.Maybe EventParameters,+ -- | The source of the event. Currently only managed CloudWatch Events rules+ -- are supported.+ type' :: EventSourceValues+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'EventSource' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'parameters', 'eventSource_parameters' - Information about the event.+--+-- 'type'', 'eventSource_type' - The source of the event. Currently only managed CloudWatch Events rules+-- are supported.+newEventSource ::+ -- | 'type''+ EventSourceValues ->+ EventSource+newEventSource pType_ =+ EventSource'+ { parameters = Prelude.Nothing,+ type' = pType_+ }++-- | Information about the event.+eventSource_parameters :: Lens.Lens' EventSource (Prelude.Maybe EventParameters)+eventSource_parameters = Lens.lens (\EventSource' {parameters} -> parameters) (\s@EventSource' {} a -> s {parameters = a} :: EventSource)++-- | The source of the event. Currently only managed CloudWatch Events rules+-- are supported.+eventSource_type :: Lens.Lens' EventSource EventSourceValues+eventSource_type = Lens.lens (\EventSource' {type'} -> type') (\s@EventSource' {} a -> s {type' = a} :: EventSource)++instance Data.FromJSON EventSource where+ parseJSON =+ Data.withObject+ "EventSource"+ ( \x ->+ EventSource'+ Prelude.<$> (x Data..:? "Parameters")+ Prelude.<*> (x Data..: "Type")+ )++instance Prelude.Hashable EventSource where+ hashWithSalt _salt EventSource' {..} =+ _salt+ `Prelude.hashWithSalt` parameters+ `Prelude.hashWithSalt` type'++instance Prelude.NFData EventSource where+ rnf EventSource' {..} =+ Prelude.rnf parameters+ `Prelude.seq` Prelude.rnf type'++instance Data.ToJSON EventSource where+ toJSON EventSource' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Parameters" Data..=) Prelude.<$> parameters,+ Prelude.Just ("Type" Data..= type')+ ]+ )
+ gen/Amazonka/DLM/Types/EventSourceValues.hs view
@@ -0,0 +1,66 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.EventSourceValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.EventSourceValues+ ( EventSourceValues+ ( ..,+ EventSourceValues_MANAGED_CWE+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype EventSourceValues = EventSourceValues'+ { fromEventSourceValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern EventSourceValues_MANAGED_CWE :: EventSourceValues+pattern EventSourceValues_MANAGED_CWE = EventSourceValues' "MANAGED_CWE"++{-# COMPLETE+ EventSourceValues_MANAGED_CWE,+ EventSourceValues'+ #-}
+ gen/Amazonka/DLM/Types/EventTypeValues.hs view
@@ -0,0 +1,66 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.EventTypeValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.EventTypeValues+ ( EventTypeValues+ ( ..,+ EventTypeValues_ShareSnapshot+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype EventTypeValues = EventTypeValues'+ { fromEventTypeValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern EventTypeValues_ShareSnapshot :: EventTypeValues+pattern EventTypeValues_ShareSnapshot = EventTypeValues' "shareSnapshot"++{-# COMPLETE+ EventTypeValues_ShareSnapshot,+ EventTypeValues'+ #-}
+ gen/Amazonka/DLM/Types/FastRestoreRule.hs view
@@ -0,0 +1,129 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.FastRestoreRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.FastRestoreRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot policies only]__ Specifies a rule for enabling fast snapshot+-- restore for snapshots created by snapshot policies. You can enable fast+-- snapshot restore based on either a count or a time interval.+--+-- /See:/ 'newFastRestoreRule' smart constructor.+data FastRestoreRule = FastRestoreRule'+ { -- | The number of snapshots to be enabled with fast snapshot restore.+ count :: Prelude.Maybe Prelude.Natural,+ -- | The amount of time to enable fast snapshot restore. The maximum is 100+ -- years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time for enabling fast snapshot restore.+ intervalUnit :: Prelude.Maybe RetentionIntervalUnitValues,+ -- | The Availability Zones in which to enable fast snapshot restore.+ availabilityZones :: Prelude.NonEmpty Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'FastRestoreRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'count', 'fastRestoreRule_count' - The number of snapshots to be enabled with fast snapshot restore.+--+-- 'interval', 'fastRestoreRule_interval' - The amount of time to enable fast snapshot restore. The maximum is 100+-- years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.+--+-- 'intervalUnit', 'fastRestoreRule_intervalUnit' - The unit of time for enabling fast snapshot restore.+--+-- 'availabilityZones', 'fastRestoreRule_availabilityZones' - The Availability Zones in which to enable fast snapshot restore.+newFastRestoreRule ::+ -- | 'availabilityZones'+ Prelude.NonEmpty Prelude.Text ->+ FastRestoreRule+newFastRestoreRule pAvailabilityZones_ =+ FastRestoreRule'+ { count = Prelude.Nothing,+ interval = Prelude.Nothing,+ intervalUnit = Prelude.Nothing,+ availabilityZones =+ Lens.coerced Lens.# pAvailabilityZones_+ }++-- | The number of snapshots to be enabled with fast snapshot restore.+fastRestoreRule_count :: Lens.Lens' FastRestoreRule (Prelude.Maybe Prelude.Natural)+fastRestoreRule_count = Lens.lens (\FastRestoreRule' {count} -> count) (\s@FastRestoreRule' {} a -> s {count = a} :: FastRestoreRule)++-- | The amount of time to enable fast snapshot restore. The maximum is 100+-- years. This is equivalent to 1200 months, 5200 weeks, or 36500 days.+fastRestoreRule_interval :: Lens.Lens' FastRestoreRule (Prelude.Maybe Prelude.Natural)+fastRestoreRule_interval = Lens.lens (\FastRestoreRule' {interval} -> interval) (\s@FastRestoreRule' {} a -> s {interval = a} :: FastRestoreRule)++-- | The unit of time for enabling fast snapshot restore.+fastRestoreRule_intervalUnit :: Lens.Lens' FastRestoreRule (Prelude.Maybe RetentionIntervalUnitValues)+fastRestoreRule_intervalUnit = Lens.lens (\FastRestoreRule' {intervalUnit} -> intervalUnit) (\s@FastRestoreRule' {} a -> s {intervalUnit = a} :: FastRestoreRule)++-- | The Availability Zones in which to enable fast snapshot restore.+fastRestoreRule_availabilityZones :: Lens.Lens' FastRestoreRule (Prelude.NonEmpty Prelude.Text)+fastRestoreRule_availabilityZones = Lens.lens (\FastRestoreRule' {availabilityZones} -> availabilityZones) (\s@FastRestoreRule' {} a -> s {availabilityZones = a} :: FastRestoreRule) Prelude.. Lens.coerced++instance Data.FromJSON FastRestoreRule where+ parseJSON =+ Data.withObject+ "FastRestoreRule"+ ( \x ->+ FastRestoreRule'+ Prelude.<$> (x Data..:? "Count")+ Prelude.<*> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ Prelude.<*> (x Data..: "AvailabilityZones")+ )++instance Prelude.Hashable FastRestoreRule where+ hashWithSalt _salt FastRestoreRule' {..} =+ _salt+ `Prelude.hashWithSalt` count+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit+ `Prelude.hashWithSalt` availabilityZones++instance Prelude.NFData FastRestoreRule where+ rnf FastRestoreRule' {..} =+ Prelude.rnf count+ `Prelude.seq` Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit+ `Prelude.seq` Prelude.rnf availabilityZones++instance Data.ToJSON FastRestoreRule where+ toJSON FastRestoreRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Count" Data..=) Prelude.<$> count,+ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit,+ Prelude.Just+ ("AvailabilityZones" Data..= availabilityZones)+ ]+ )
+ gen/Amazonka/DLM/Types/GettablePolicyStateValues.hs view
@@ -0,0 +1,76 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.GettablePolicyStateValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.GettablePolicyStateValues+ ( GettablePolicyStateValues+ ( ..,+ GettablePolicyStateValues_DISABLED,+ GettablePolicyStateValues_ENABLED,+ GettablePolicyStateValues_ERROR+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype GettablePolicyStateValues = GettablePolicyStateValues'+ { fromGettablePolicyStateValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern GettablePolicyStateValues_DISABLED :: GettablePolicyStateValues+pattern GettablePolicyStateValues_DISABLED = GettablePolicyStateValues' "DISABLED"++pattern GettablePolicyStateValues_ENABLED :: GettablePolicyStateValues+pattern GettablePolicyStateValues_ENABLED = GettablePolicyStateValues' "ENABLED"++pattern GettablePolicyStateValues_ERROR :: GettablePolicyStateValues+pattern GettablePolicyStateValues_ERROR = GettablePolicyStateValues' "ERROR"++{-# COMPLETE+ GettablePolicyStateValues_DISABLED,+ GettablePolicyStateValues_ENABLED,+ GettablePolicyStateValues_ERROR,+ GettablePolicyStateValues'+ #-}
+ gen/Amazonka/DLM/Types/IntervalUnitValues.hs view
@@ -0,0 +1,66 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.IntervalUnitValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.IntervalUnitValues+ ( IntervalUnitValues+ ( ..,+ IntervalUnitValues_HOURS+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype IntervalUnitValues = IntervalUnitValues'+ { fromIntervalUnitValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern IntervalUnitValues_HOURS :: IntervalUnitValues+pattern IntervalUnitValues_HOURS = IntervalUnitValues' "HOURS"++{-# COMPLETE+ IntervalUnitValues_HOURS,+ IntervalUnitValues'+ #-}
+ gen/Amazonka/DLM/Types/LifecyclePolicy.hs view
@@ -0,0 +1,186 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.LifecyclePolicy+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.LifecyclePolicy where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.GettablePolicyStateValues+import Amazonka.DLM.Types.PolicyDetails+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[All policy types]__ Detailed information about a snapshot, AMI, or+-- event-based lifecycle policy.+--+-- /See:/ 'newLifecyclePolicy' smart constructor.+data LifecyclePolicy = LifecyclePolicy'+ { -- | The local date and time when the lifecycle policy was created.+ dateCreated :: Prelude.Maybe Data.ISO8601,+ -- | The local date and time when the lifecycle policy was last modified.+ dateModified :: Prelude.Maybe Data.ISO8601,+ -- | The description of the lifecycle policy.+ description :: Prelude.Maybe Prelude.Text,+ -- | The Amazon Resource Name (ARN) of the IAM role used to run the+ -- operations specified by the lifecycle policy.+ executionRoleArn :: Prelude.Maybe Prelude.Text,+ -- | The Amazon Resource Name (ARN) of the policy.+ policyArn :: Prelude.Maybe Prelude.Text,+ -- | The configuration of the lifecycle policy+ policyDetails :: Prelude.Maybe PolicyDetails,+ -- | The identifier of the lifecycle policy.+ policyId :: Prelude.Maybe Prelude.Text,+ -- | The activation state of the lifecycle policy.+ state :: Prelude.Maybe GettablePolicyStateValues,+ -- | The description of the status.+ statusMessage :: Prelude.Maybe Prelude.Text,+ -- | The tags.+ tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'LifecyclePolicy' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'dateCreated', 'lifecyclePolicy_dateCreated' - The local date and time when the lifecycle policy was created.+--+-- 'dateModified', 'lifecyclePolicy_dateModified' - The local date and time when the lifecycle policy was last modified.+--+-- 'description', 'lifecyclePolicy_description' - The description of the lifecycle policy.+--+-- 'executionRoleArn', 'lifecyclePolicy_executionRoleArn' - The Amazon Resource Name (ARN) of the IAM role used to run the+-- operations specified by the lifecycle policy.+--+-- 'policyArn', 'lifecyclePolicy_policyArn' - The Amazon Resource Name (ARN) of the policy.+--+-- 'policyDetails', 'lifecyclePolicy_policyDetails' - The configuration of the lifecycle policy+--+-- 'policyId', 'lifecyclePolicy_policyId' - The identifier of the lifecycle policy.+--+-- 'state', 'lifecyclePolicy_state' - The activation state of the lifecycle policy.+--+-- 'statusMessage', 'lifecyclePolicy_statusMessage' - The description of the status.+--+-- 'tags', 'lifecyclePolicy_tags' - The tags.+newLifecyclePolicy ::+ LifecyclePolicy+newLifecyclePolicy =+ LifecyclePolicy'+ { dateCreated = Prelude.Nothing,+ dateModified = Prelude.Nothing,+ description = Prelude.Nothing,+ executionRoleArn = Prelude.Nothing,+ policyArn = Prelude.Nothing,+ policyDetails = Prelude.Nothing,+ policyId = Prelude.Nothing,+ state = Prelude.Nothing,+ statusMessage = Prelude.Nothing,+ tags = Prelude.Nothing+ }++-- | The local date and time when the lifecycle policy was created.+lifecyclePolicy_dateCreated :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.UTCTime)+lifecyclePolicy_dateCreated = Lens.lens (\LifecyclePolicy' {dateCreated} -> dateCreated) (\s@LifecyclePolicy' {} a -> s {dateCreated = a} :: LifecyclePolicy) Prelude.. Lens.mapping Data._Time++-- | The local date and time when the lifecycle policy was last modified.+lifecyclePolicy_dateModified :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.UTCTime)+lifecyclePolicy_dateModified = Lens.lens (\LifecyclePolicy' {dateModified} -> dateModified) (\s@LifecyclePolicy' {} a -> s {dateModified = a} :: LifecyclePolicy) Prelude.. Lens.mapping Data._Time++-- | The description of the lifecycle policy.+lifecyclePolicy_description :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)+lifecyclePolicy_description = Lens.lens (\LifecyclePolicy' {description} -> description) (\s@LifecyclePolicy' {} a -> s {description = a} :: LifecyclePolicy)++-- | The Amazon Resource Name (ARN) of the IAM role used to run the+-- operations specified by the lifecycle policy.+lifecyclePolicy_executionRoleArn :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)+lifecyclePolicy_executionRoleArn = Lens.lens (\LifecyclePolicy' {executionRoleArn} -> executionRoleArn) (\s@LifecyclePolicy' {} a -> s {executionRoleArn = a} :: LifecyclePolicy)++-- | The Amazon Resource Name (ARN) of the policy.+lifecyclePolicy_policyArn :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)+lifecyclePolicy_policyArn = Lens.lens (\LifecyclePolicy' {policyArn} -> policyArn) (\s@LifecyclePolicy' {} a -> s {policyArn = a} :: LifecyclePolicy)++-- | The configuration of the lifecycle policy+lifecyclePolicy_policyDetails :: Lens.Lens' LifecyclePolicy (Prelude.Maybe PolicyDetails)+lifecyclePolicy_policyDetails = Lens.lens (\LifecyclePolicy' {policyDetails} -> policyDetails) (\s@LifecyclePolicy' {} a -> s {policyDetails = a} :: LifecyclePolicy)++-- | The identifier of the lifecycle policy.+lifecyclePolicy_policyId :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)+lifecyclePolicy_policyId = Lens.lens (\LifecyclePolicy' {policyId} -> policyId) (\s@LifecyclePolicy' {} a -> s {policyId = a} :: LifecyclePolicy)++-- | The activation state of the lifecycle policy.+lifecyclePolicy_state :: Lens.Lens' LifecyclePolicy (Prelude.Maybe GettablePolicyStateValues)+lifecyclePolicy_state = Lens.lens (\LifecyclePolicy' {state} -> state) (\s@LifecyclePolicy' {} a -> s {state = a} :: LifecyclePolicy)++-- | The description of the status.+lifecyclePolicy_statusMessage :: Lens.Lens' LifecyclePolicy (Prelude.Maybe Prelude.Text)+lifecyclePolicy_statusMessage = Lens.lens (\LifecyclePolicy' {statusMessage} -> statusMessage) (\s@LifecyclePolicy' {} a -> s {statusMessage = a} :: LifecyclePolicy)++-- | The tags.+lifecyclePolicy_tags :: Lens.Lens' LifecyclePolicy (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))+lifecyclePolicy_tags = Lens.lens (\LifecyclePolicy' {tags} -> tags) (\s@LifecyclePolicy' {} a -> s {tags = a} :: LifecyclePolicy) Prelude.. Lens.mapping Lens.coerced++instance Data.FromJSON LifecyclePolicy where+ parseJSON =+ Data.withObject+ "LifecyclePolicy"+ ( \x ->+ LifecyclePolicy'+ Prelude.<$> (x Data..:? "DateCreated")+ Prelude.<*> (x Data..:? "DateModified")+ Prelude.<*> (x Data..:? "Description")+ Prelude.<*> (x Data..:? "ExecutionRoleArn")+ Prelude.<*> (x Data..:? "PolicyArn")+ Prelude.<*> (x Data..:? "PolicyDetails")+ Prelude.<*> (x Data..:? "PolicyId")+ Prelude.<*> (x Data..:? "State")+ Prelude.<*> (x Data..:? "StatusMessage")+ Prelude.<*> (x Data..:? "Tags" Data..!= Prelude.mempty)+ )++instance Prelude.Hashable LifecyclePolicy where+ hashWithSalt _salt LifecyclePolicy' {..} =+ _salt+ `Prelude.hashWithSalt` dateCreated+ `Prelude.hashWithSalt` dateModified+ `Prelude.hashWithSalt` description+ `Prelude.hashWithSalt` executionRoleArn+ `Prelude.hashWithSalt` policyArn+ `Prelude.hashWithSalt` policyDetails+ `Prelude.hashWithSalt` policyId+ `Prelude.hashWithSalt` state+ `Prelude.hashWithSalt` statusMessage+ `Prelude.hashWithSalt` tags++instance Prelude.NFData LifecyclePolicy where+ rnf LifecyclePolicy' {..} =+ Prelude.rnf dateCreated+ `Prelude.seq` Prelude.rnf dateModified+ `Prelude.seq` Prelude.rnf description+ `Prelude.seq` Prelude.rnf executionRoleArn+ `Prelude.seq` Prelude.rnf policyArn+ `Prelude.seq` Prelude.rnf policyDetails+ `Prelude.seq` Prelude.rnf policyId+ `Prelude.seq` Prelude.rnf state+ `Prelude.seq` Prelude.rnf statusMessage+ `Prelude.seq` Prelude.rnf tags
+ gen/Amazonka/DLM/Types/LifecyclePolicySummary.hs view
@@ -0,0 +1,135 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.LifecyclePolicySummary+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.LifecyclePolicySummary where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.GettablePolicyStateValues+import Amazonka.DLM.Types.PolicyTypeValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | Summary information about a lifecycle policy.+--+-- /See:/ 'newLifecyclePolicySummary' smart constructor.+data LifecyclePolicySummary = LifecyclePolicySummary'+ { -- | The description of the lifecycle policy.+ description :: Prelude.Maybe Prelude.Text,+ -- | The identifier of the lifecycle policy.+ policyId :: Prelude.Maybe Prelude.Text,+ -- | The type of policy. @EBS_SNAPSHOT_MANAGEMENT@ indicates that the policy+ -- manages the lifecycle of Amazon EBS snapshots. @IMAGE_MANAGEMENT@+ -- indicates that the policy manages the lifecycle of EBS-backed AMIs.+ -- @EVENT_BASED_POLICY@ indicates that the policy automates cross-account+ -- snapshot copies for snapshots that are shared with your account.+ policyType :: Prelude.Maybe PolicyTypeValues,+ -- | The activation state of the lifecycle policy.+ state :: Prelude.Maybe GettablePolicyStateValues,+ -- | The tags.+ tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'LifecyclePolicySummary' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'description', 'lifecyclePolicySummary_description' - The description of the lifecycle policy.+--+-- 'policyId', 'lifecyclePolicySummary_policyId' - The identifier of the lifecycle policy.+--+-- 'policyType', 'lifecyclePolicySummary_policyType' - The type of policy. @EBS_SNAPSHOT_MANAGEMENT@ indicates that the policy+-- manages the lifecycle of Amazon EBS snapshots. @IMAGE_MANAGEMENT@+-- indicates that the policy manages the lifecycle of EBS-backed AMIs.+-- @EVENT_BASED_POLICY@ indicates that the policy automates cross-account+-- snapshot copies for snapshots that are shared with your account.+--+-- 'state', 'lifecyclePolicySummary_state' - The activation state of the lifecycle policy.+--+-- 'tags', 'lifecyclePolicySummary_tags' - The tags.+newLifecyclePolicySummary ::+ LifecyclePolicySummary+newLifecyclePolicySummary =+ LifecyclePolicySummary'+ { description =+ Prelude.Nothing,+ policyId = Prelude.Nothing,+ policyType = Prelude.Nothing,+ state = Prelude.Nothing,+ tags = Prelude.Nothing+ }++-- | The description of the lifecycle policy.+lifecyclePolicySummary_description :: Lens.Lens' LifecyclePolicySummary (Prelude.Maybe Prelude.Text)+lifecyclePolicySummary_description = Lens.lens (\LifecyclePolicySummary' {description} -> description) (\s@LifecyclePolicySummary' {} a -> s {description = a} :: LifecyclePolicySummary)++-- | The identifier of the lifecycle policy.+lifecyclePolicySummary_policyId :: Lens.Lens' LifecyclePolicySummary (Prelude.Maybe Prelude.Text)+lifecyclePolicySummary_policyId = Lens.lens (\LifecyclePolicySummary' {policyId} -> policyId) (\s@LifecyclePolicySummary' {} a -> s {policyId = a} :: LifecyclePolicySummary)++-- | The type of policy. @EBS_SNAPSHOT_MANAGEMENT@ indicates that the policy+-- manages the lifecycle of Amazon EBS snapshots. @IMAGE_MANAGEMENT@+-- indicates that the policy manages the lifecycle of EBS-backed AMIs.+-- @EVENT_BASED_POLICY@ indicates that the policy automates cross-account+-- snapshot copies for snapshots that are shared with your account.+lifecyclePolicySummary_policyType :: Lens.Lens' LifecyclePolicySummary (Prelude.Maybe PolicyTypeValues)+lifecyclePolicySummary_policyType = Lens.lens (\LifecyclePolicySummary' {policyType} -> policyType) (\s@LifecyclePolicySummary' {} a -> s {policyType = a} :: LifecyclePolicySummary)++-- | The activation state of the lifecycle policy.+lifecyclePolicySummary_state :: Lens.Lens' LifecyclePolicySummary (Prelude.Maybe GettablePolicyStateValues)+lifecyclePolicySummary_state = Lens.lens (\LifecyclePolicySummary' {state} -> state) (\s@LifecyclePolicySummary' {} a -> s {state = a} :: LifecyclePolicySummary)++-- | The tags.+lifecyclePolicySummary_tags :: Lens.Lens' LifecyclePolicySummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))+lifecyclePolicySummary_tags = Lens.lens (\LifecyclePolicySummary' {tags} -> tags) (\s@LifecyclePolicySummary' {} a -> s {tags = a} :: LifecyclePolicySummary) Prelude.. Lens.mapping Lens.coerced++instance Data.FromJSON LifecyclePolicySummary where+ parseJSON =+ Data.withObject+ "LifecyclePolicySummary"+ ( \x ->+ LifecyclePolicySummary'+ Prelude.<$> (x Data..:? "Description")+ Prelude.<*> (x Data..:? "PolicyId")+ Prelude.<*> (x Data..:? "PolicyType")+ Prelude.<*> (x Data..:? "State")+ Prelude.<*> (x Data..:? "Tags" Data..!= Prelude.mempty)+ )++instance Prelude.Hashable LifecyclePolicySummary where+ hashWithSalt _salt LifecyclePolicySummary' {..} =+ _salt+ `Prelude.hashWithSalt` description+ `Prelude.hashWithSalt` policyId+ `Prelude.hashWithSalt` policyType+ `Prelude.hashWithSalt` state+ `Prelude.hashWithSalt` tags++instance Prelude.NFData LifecyclePolicySummary where+ rnf LifecyclePolicySummary' {..} =+ Prelude.rnf description+ `Prelude.seq` Prelude.rnf policyId+ `Prelude.seq` Prelude.rnf policyType+ `Prelude.seq` Prelude.rnf state+ `Prelude.seq` Prelude.rnf tags
+ gen/Amazonka/DLM/Types/LocationValues.hs view
@@ -0,0 +1,71 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.LocationValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.LocationValues+ ( LocationValues+ ( ..,+ LocationValues_CLOUD,+ LocationValues_OUTPOST_LOCAL+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype LocationValues = LocationValues'+ { fromLocationValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern LocationValues_CLOUD :: LocationValues+pattern LocationValues_CLOUD = LocationValues' "CLOUD"++pattern LocationValues_OUTPOST_LOCAL :: LocationValues+pattern LocationValues_OUTPOST_LOCAL = LocationValues' "OUTPOST_LOCAL"++{-# COMPLETE+ LocationValues_CLOUD,+ LocationValues_OUTPOST_LOCAL,+ LocationValues'+ #-}
+ gen/Amazonka/DLM/Types/Parameters.hs view
@@ -0,0 +1,167 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.Parameters+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.Parameters where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.Tag+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot and AMI policies only]__ Specifies optional parameters for+-- snapshot and AMI policies. The set of valid parameters depends on the+-- combination of policy type and target resource type.+--+-- If you choose to exclude boot volumes and you specify tags that+-- consequently exclude all of the additional data volumes attached to an+-- instance, then Amazon Data Lifecycle Manager will not create any+-- snapshots for the affected instance, and it will emit a+-- @SnapshotsCreateFailed@ Amazon CloudWatch metric. For more information,+-- see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-dlm-cw-metrics.html Monitor your policies using Amazon CloudWatch>.+--+-- /See:/ 'newParameters' smart constructor.+data Parameters = Parameters'+ { -- | __[Snapshot policies that target instances only]__ Indicates whether to+ -- exclude the root volume from multi-volume snapshot sets. The default is+ -- @false@. If you specify @true@, then the root volumes attached to+ -- targeted instances will be excluded from the multi-volume snapshot sets+ -- created by the policy.+ excludeBootVolume :: Prelude.Maybe Prelude.Bool,+ -- | __[Snapshot policies that target instances only]__ The tags used to+ -- identify data (non-root) volumes to exclude from multi-volume snapshot+ -- sets.+ --+ -- If you create a snapshot lifecycle policy that targets instances and you+ -- specify tags for this parameter, then data volumes with the specified+ -- tags that are attached to targeted instances will be excluded from the+ -- multi-volume snapshot sets created by the policy.+ excludeDataVolumeTags :: Prelude.Maybe [Tag],+ -- | __[AMI policies only]__ Indicates whether targeted instances are+ -- rebooted when the lifecycle policy runs. @true@ indicates that targeted+ -- instances are not rebooted when the policy runs. @false@ indicates that+ -- target instances are rebooted when the policy runs. The default is+ -- @true@ (instances are not rebooted).+ noReboot :: Prelude.Maybe Prelude.Bool+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'Parameters' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'excludeBootVolume', 'parameters_excludeBootVolume' - __[Snapshot policies that target instances only]__ Indicates whether to+-- exclude the root volume from multi-volume snapshot sets. The default is+-- @false@. If you specify @true@, then the root volumes attached to+-- targeted instances will be excluded from the multi-volume snapshot sets+-- created by the policy.+--+-- 'excludeDataVolumeTags', 'parameters_excludeDataVolumeTags' - __[Snapshot policies that target instances only]__ The tags used to+-- identify data (non-root) volumes to exclude from multi-volume snapshot+-- sets.+--+-- If you create a snapshot lifecycle policy that targets instances and you+-- specify tags for this parameter, then data volumes with the specified+-- tags that are attached to targeted instances will be excluded from the+-- multi-volume snapshot sets created by the policy.+--+-- 'noReboot', 'parameters_noReboot' - __[AMI policies only]__ Indicates whether targeted instances are+-- rebooted when the lifecycle policy runs. @true@ indicates that targeted+-- instances are not rebooted when the policy runs. @false@ indicates that+-- target instances are rebooted when the policy runs. The default is+-- @true@ (instances are not rebooted).+newParameters ::+ Parameters+newParameters =+ Parameters'+ { excludeBootVolume = Prelude.Nothing,+ excludeDataVolumeTags = Prelude.Nothing,+ noReboot = Prelude.Nothing+ }++-- | __[Snapshot policies that target instances only]__ Indicates whether to+-- exclude the root volume from multi-volume snapshot sets. The default is+-- @false@. If you specify @true@, then the root volumes attached to+-- targeted instances will be excluded from the multi-volume snapshot sets+-- created by the policy.+parameters_excludeBootVolume :: Lens.Lens' Parameters (Prelude.Maybe Prelude.Bool)+parameters_excludeBootVolume = Lens.lens (\Parameters' {excludeBootVolume} -> excludeBootVolume) (\s@Parameters' {} a -> s {excludeBootVolume = a} :: Parameters)++-- | __[Snapshot policies that target instances only]__ The tags used to+-- identify data (non-root) volumes to exclude from multi-volume snapshot+-- sets.+--+-- If you create a snapshot lifecycle policy that targets instances and you+-- specify tags for this parameter, then data volumes with the specified+-- tags that are attached to targeted instances will be excluded from the+-- multi-volume snapshot sets created by the policy.+parameters_excludeDataVolumeTags :: Lens.Lens' Parameters (Prelude.Maybe [Tag])+parameters_excludeDataVolumeTags = Lens.lens (\Parameters' {excludeDataVolumeTags} -> excludeDataVolumeTags) (\s@Parameters' {} a -> s {excludeDataVolumeTags = a} :: Parameters) Prelude.. Lens.mapping Lens.coerced++-- | __[AMI policies only]__ Indicates whether targeted instances are+-- rebooted when the lifecycle policy runs. @true@ indicates that targeted+-- instances are not rebooted when the policy runs. @false@ indicates that+-- target instances are rebooted when the policy runs. The default is+-- @true@ (instances are not rebooted).+parameters_noReboot :: Lens.Lens' Parameters (Prelude.Maybe Prelude.Bool)+parameters_noReboot = Lens.lens (\Parameters' {noReboot} -> noReboot) (\s@Parameters' {} a -> s {noReboot = a} :: Parameters)++instance Data.FromJSON Parameters where+ parseJSON =+ Data.withObject+ "Parameters"+ ( \x ->+ Parameters'+ Prelude.<$> (x Data..:? "ExcludeBootVolume")+ Prelude.<*> ( x+ Data..:? "ExcludeDataVolumeTags"+ Data..!= Prelude.mempty+ )+ Prelude.<*> (x Data..:? "NoReboot")+ )++instance Prelude.Hashable Parameters where+ hashWithSalt _salt Parameters' {..} =+ _salt+ `Prelude.hashWithSalt` excludeBootVolume+ `Prelude.hashWithSalt` excludeDataVolumeTags+ `Prelude.hashWithSalt` noReboot++instance Prelude.NFData Parameters where+ rnf Parameters' {..} =+ Prelude.rnf excludeBootVolume+ `Prelude.seq` Prelude.rnf excludeDataVolumeTags+ `Prelude.seq` Prelude.rnf noReboot++instance Data.ToJSON Parameters where+ toJSON Parameters' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ExcludeBootVolume" Data..=)+ Prelude.<$> excludeBootVolume,+ ("ExcludeDataVolumeTags" Data..=)+ Prelude.<$> excludeDataVolumeTags,+ ("NoReboot" Data..=) Prelude.<$> noReboot+ ]+ )
+ gen/Amazonka/DLM/Types/PolicyDetails.hs view
@@ -0,0 +1,277 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.PolicyDetails+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.PolicyDetails where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.Action+import Amazonka.DLM.Types.EventSource+import Amazonka.DLM.Types.Parameters+import Amazonka.DLM.Types.PolicyTypeValues+import Amazonka.DLM.Types.ResourceLocationValues+import Amazonka.DLM.Types.ResourceTypeValues+import Amazonka.DLM.Types.Schedule+import Amazonka.DLM.Types.Tag+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[All policy types]__ Specifies the configuration of a lifecycle+-- policy.+--+-- /See:/ 'newPolicyDetails' smart constructor.+data PolicyDetails = PolicyDetails'+ { -- | __[Event-based policies only]__ The actions to be performed when the+ -- event-based policy is activated. You can specify only one action per+ -- policy.+ actions :: Prelude.Maybe (Prelude.NonEmpty Action),+ -- | __[Event-based policies only]__ The event that activates the event-based+ -- policy.+ eventSource :: Prelude.Maybe EventSource,+ -- | __[Snapshot and AMI policies only]__ A set of optional parameters for+ -- snapshot and AMI lifecycle policies.+ --+ -- If you are modifying a policy that was created or previously modified+ -- using the Amazon Data Lifecycle Manager console, then you must include+ -- this parameter and specify either the default values or the new values+ -- that you require. You can\'t omit this parameter or set its values to+ -- null.+ parameters :: Prelude.Maybe Parameters,+ -- | __[All policy types]__ The valid target resource types and actions a+ -- policy can manage. Specify @EBS_SNAPSHOT_MANAGEMENT@ to create a+ -- lifecycle policy that manages the lifecycle of Amazon EBS snapshots.+ -- Specify @IMAGE_MANAGEMENT@ to create a lifecycle policy that manages the+ -- lifecycle of EBS-backed AMIs. Specify @EVENT_BASED_POLICY @ to create an+ -- event-based policy that performs specific actions when a defined event+ -- occurs in your Amazon Web Services account.+ --+ -- The default is @EBS_SNAPSHOT_MANAGEMENT@.+ policyType :: Prelude.Maybe PolicyTypeValues,+ -- | __[Snapshot and AMI policies only]__ The location of the resources to+ -- backup. If the source resources are located in an Amazon Web Services+ -- Region, specify @CLOUD@. If the source resources are located on an+ -- Outpost in your account, specify @OUTPOST@.+ --+ -- If you specify @OUTPOST@, Amazon Data Lifecycle Manager backs up all+ -- resources of the specified type with matching target tags across all of+ -- the Outposts in your account.+ resourceLocations :: Prelude.Maybe (Prelude.NonEmpty ResourceLocationValues),+ -- | __[Snapshot policies only]__ The target resource type for snapshot and+ -- AMI lifecycle policies. Use @VOLUME @to create snapshots of individual+ -- volumes or use @INSTANCE@ to create multi-volume snapshots from the+ -- volumes for an instance.+ resourceTypes :: Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues),+ -- | __[Snapshot and AMI policies only]__ The schedules of policy-defined+ -- actions for snapshot and AMI lifecycle policies. A policy can have up to+ -- four schedules—one mandatory schedule and up to three optional+ -- schedules.+ schedules :: Prelude.Maybe (Prelude.NonEmpty Schedule),+ -- | __[Snapshot and AMI policies only]__ The single tag that identifies+ -- targeted resources for this policy.+ targetTags :: Prelude.Maybe (Prelude.NonEmpty Tag)+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'PolicyDetails' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'actions', 'policyDetails_actions' - __[Event-based policies only]__ The actions to be performed when the+-- event-based policy is activated. You can specify only one action per+-- policy.+--+-- 'eventSource', 'policyDetails_eventSource' - __[Event-based policies only]__ The event that activates the event-based+-- policy.+--+-- 'parameters', 'policyDetails_parameters' - __[Snapshot and AMI policies only]__ A set of optional parameters for+-- snapshot and AMI lifecycle policies.+--+-- If you are modifying a policy that was created or previously modified+-- using the Amazon Data Lifecycle Manager console, then you must include+-- this parameter and specify either the default values or the new values+-- that you require. You can\'t omit this parameter or set its values to+-- null.+--+-- 'policyType', 'policyDetails_policyType' - __[All policy types]__ The valid target resource types and actions a+-- policy can manage. Specify @EBS_SNAPSHOT_MANAGEMENT@ to create a+-- lifecycle policy that manages the lifecycle of Amazon EBS snapshots.+-- Specify @IMAGE_MANAGEMENT@ to create a lifecycle policy that manages the+-- lifecycle of EBS-backed AMIs. Specify @EVENT_BASED_POLICY @ to create an+-- event-based policy that performs specific actions when a defined event+-- occurs in your Amazon Web Services account.+--+-- The default is @EBS_SNAPSHOT_MANAGEMENT@.+--+-- 'resourceLocations', 'policyDetails_resourceLocations' - __[Snapshot and AMI policies only]__ The location of the resources to+-- backup. If the source resources are located in an Amazon Web Services+-- Region, specify @CLOUD@. If the source resources are located on an+-- Outpost in your account, specify @OUTPOST@.+--+-- If you specify @OUTPOST@, Amazon Data Lifecycle Manager backs up all+-- resources of the specified type with matching target tags across all of+-- the Outposts in your account.+--+-- 'resourceTypes', 'policyDetails_resourceTypes' - __[Snapshot policies only]__ The target resource type for snapshot and+-- AMI lifecycle policies. Use @VOLUME @to create snapshots of individual+-- volumes or use @INSTANCE@ to create multi-volume snapshots from the+-- volumes for an instance.+--+-- 'schedules', 'policyDetails_schedules' - __[Snapshot and AMI policies only]__ The schedules of policy-defined+-- actions for snapshot and AMI lifecycle policies. A policy can have up to+-- four schedules—one mandatory schedule and up to three optional+-- schedules.+--+-- 'targetTags', 'policyDetails_targetTags' - __[Snapshot and AMI policies only]__ The single tag that identifies+-- targeted resources for this policy.+newPolicyDetails ::+ PolicyDetails+newPolicyDetails =+ PolicyDetails'+ { actions = Prelude.Nothing,+ eventSource = Prelude.Nothing,+ parameters = Prelude.Nothing,+ policyType = Prelude.Nothing,+ resourceLocations = Prelude.Nothing,+ resourceTypes = Prelude.Nothing,+ schedules = Prelude.Nothing,+ targetTags = Prelude.Nothing+ }++-- | __[Event-based policies only]__ The actions to be performed when the+-- event-based policy is activated. You can specify only one action per+-- policy.+policyDetails_actions :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty Action))+policyDetails_actions = Lens.lens (\PolicyDetails' {actions} -> actions) (\s@PolicyDetails' {} a -> s {actions = a} :: PolicyDetails) Prelude.. Lens.mapping Lens.coerced++-- | __[Event-based policies only]__ The event that activates the event-based+-- policy.+policyDetails_eventSource :: Lens.Lens' PolicyDetails (Prelude.Maybe EventSource)+policyDetails_eventSource = Lens.lens (\PolicyDetails' {eventSource} -> eventSource) (\s@PolicyDetails' {} a -> s {eventSource = a} :: PolicyDetails)++-- | __[Snapshot and AMI policies only]__ A set of optional parameters for+-- snapshot and AMI lifecycle policies.+--+-- If you are modifying a policy that was created or previously modified+-- using the Amazon Data Lifecycle Manager console, then you must include+-- this parameter and specify either the default values or the new values+-- that you require. You can\'t omit this parameter or set its values to+-- null.+policyDetails_parameters :: Lens.Lens' PolicyDetails (Prelude.Maybe Parameters)+policyDetails_parameters = Lens.lens (\PolicyDetails' {parameters} -> parameters) (\s@PolicyDetails' {} a -> s {parameters = a} :: PolicyDetails)++-- | __[All policy types]__ The valid target resource types and actions a+-- policy can manage. Specify @EBS_SNAPSHOT_MANAGEMENT@ to create a+-- lifecycle policy that manages the lifecycle of Amazon EBS snapshots.+-- Specify @IMAGE_MANAGEMENT@ to create a lifecycle policy that manages the+-- lifecycle of EBS-backed AMIs. Specify @EVENT_BASED_POLICY @ to create an+-- event-based policy that performs specific actions when a defined event+-- occurs in your Amazon Web Services account.+--+-- The default is @EBS_SNAPSHOT_MANAGEMENT@.+policyDetails_policyType :: Lens.Lens' PolicyDetails (Prelude.Maybe PolicyTypeValues)+policyDetails_policyType = Lens.lens (\PolicyDetails' {policyType} -> policyType) (\s@PolicyDetails' {} a -> s {policyType = a} :: PolicyDetails)++-- | __[Snapshot and AMI policies only]__ The location of the resources to+-- backup. If the source resources are located in an Amazon Web Services+-- Region, specify @CLOUD@. If the source resources are located on an+-- Outpost in your account, specify @OUTPOST@.+--+-- If you specify @OUTPOST@, Amazon Data Lifecycle Manager backs up all+-- resources of the specified type with matching target tags across all of+-- the Outposts in your account.+policyDetails_resourceLocations :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty ResourceLocationValues))+policyDetails_resourceLocations = Lens.lens (\PolicyDetails' {resourceLocations} -> resourceLocations) (\s@PolicyDetails' {} a -> s {resourceLocations = a} :: PolicyDetails) Prelude.. Lens.mapping Lens.coerced++-- | __[Snapshot policies only]__ The target resource type for snapshot and+-- AMI lifecycle policies. Use @VOLUME @to create snapshots of individual+-- volumes or use @INSTANCE@ to create multi-volume snapshots from the+-- volumes for an instance.+policyDetails_resourceTypes :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty ResourceTypeValues))+policyDetails_resourceTypes = Lens.lens (\PolicyDetails' {resourceTypes} -> resourceTypes) (\s@PolicyDetails' {} a -> s {resourceTypes = a} :: PolicyDetails) Prelude.. Lens.mapping Lens.coerced++-- | __[Snapshot and AMI policies only]__ The schedules of policy-defined+-- actions for snapshot and AMI lifecycle policies. A policy can have up to+-- four schedules—one mandatory schedule and up to three optional+-- schedules.+policyDetails_schedules :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty Schedule))+policyDetails_schedules = Lens.lens (\PolicyDetails' {schedules} -> schedules) (\s@PolicyDetails' {} a -> s {schedules = a} :: PolicyDetails) Prelude.. Lens.mapping Lens.coerced++-- | __[Snapshot and AMI policies only]__ The single tag that identifies+-- targeted resources for this policy.+policyDetails_targetTags :: Lens.Lens' PolicyDetails (Prelude.Maybe (Prelude.NonEmpty Tag))+policyDetails_targetTags = Lens.lens (\PolicyDetails' {targetTags} -> targetTags) (\s@PolicyDetails' {} a -> s {targetTags = a} :: PolicyDetails) Prelude.. Lens.mapping Lens.coerced++instance Data.FromJSON PolicyDetails where+ parseJSON =+ Data.withObject+ "PolicyDetails"+ ( \x ->+ PolicyDetails'+ Prelude.<$> (x Data..:? "Actions")+ Prelude.<*> (x Data..:? "EventSource")+ Prelude.<*> (x Data..:? "Parameters")+ Prelude.<*> (x Data..:? "PolicyType")+ Prelude.<*> (x Data..:? "ResourceLocations")+ Prelude.<*> (x Data..:? "ResourceTypes")+ Prelude.<*> (x Data..:? "Schedules")+ Prelude.<*> (x Data..:? "TargetTags")+ )++instance Prelude.Hashable PolicyDetails where+ hashWithSalt _salt PolicyDetails' {..} =+ _salt+ `Prelude.hashWithSalt` actions+ `Prelude.hashWithSalt` eventSource+ `Prelude.hashWithSalt` parameters+ `Prelude.hashWithSalt` policyType+ `Prelude.hashWithSalt` resourceLocations+ `Prelude.hashWithSalt` resourceTypes+ `Prelude.hashWithSalt` schedules+ `Prelude.hashWithSalt` targetTags++instance Prelude.NFData PolicyDetails where+ rnf PolicyDetails' {..} =+ Prelude.rnf actions+ `Prelude.seq` Prelude.rnf eventSource+ `Prelude.seq` Prelude.rnf parameters+ `Prelude.seq` Prelude.rnf policyType+ `Prelude.seq` Prelude.rnf resourceLocations+ `Prelude.seq` Prelude.rnf resourceTypes+ `Prelude.seq` Prelude.rnf schedules+ `Prelude.seq` Prelude.rnf targetTags++instance Data.ToJSON PolicyDetails where+ toJSON PolicyDetails' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Actions" Data..=) Prelude.<$> actions,+ ("EventSource" Data..=) Prelude.<$> eventSource,+ ("Parameters" Data..=) Prelude.<$> parameters,+ ("PolicyType" Data..=) Prelude.<$> policyType,+ ("ResourceLocations" Data..=)+ Prelude.<$> resourceLocations,+ ("ResourceTypes" Data..=) Prelude.<$> resourceTypes,+ ("Schedules" Data..=) Prelude.<$> schedules,+ ("TargetTags" Data..=) Prelude.<$> targetTags+ ]+ )
+ gen/Amazonka/DLM/Types/PolicyTypeValues.hs view
@@ -0,0 +1,76 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.PolicyTypeValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.PolicyTypeValues+ ( PolicyTypeValues+ ( ..,+ PolicyTypeValues_EBS_SNAPSHOT_MANAGEMENT,+ PolicyTypeValues_EVENT_BASED_POLICY,+ PolicyTypeValues_IMAGE_MANAGEMENT+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype PolicyTypeValues = PolicyTypeValues'+ { fromPolicyTypeValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern PolicyTypeValues_EBS_SNAPSHOT_MANAGEMENT :: PolicyTypeValues+pattern PolicyTypeValues_EBS_SNAPSHOT_MANAGEMENT = PolicyTypeValues' "EBS_SNAPSHOT_MANAGEMENT"++pattern PolicyTypeValues_EVENT_BASED_POLICY :: PolicyTypeValues+pattern PolicyTypeValues_EVENT_BASED_POLICY = PolicyTypeValues' "EVENT_BASED_POLICY"++pattern PolicyTypeValues_IMAGE_MANAGEMENT :: PolicyTypeValues+pattern PolicyTypeValues_IMAGE_MANAGEMENT = PolicyTypeValues' "IMAGE_MANAGEMENT"++{-# COMPLETE+ PolicyTypeValues_EBS_SNAPSHOT_MANAGEMENT,+ PolicyTypeValues_EVENT_BASED_POLICY,+ PolicyTypeValues_IMAGE_MANAGEMENT,+ PolicyTypeValues'+ #-}
+ gen/Amazonka/DLM/Types/ResourceLocationValues.hs view
@@ -0,0 +1,71 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.ResourceLocationValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.ResourceLocationValues+ ( ResourceLocationValues+ ( ..,+ ResourceLocationValues_CLOUD,+ ResourceLocationValues_OUTPOST+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype ResourceLocationValues = ResourceLocationValues'+ { fromResourceLocationValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern ResourceLocationValues_CLOUD :: ResourceLocationValues+pattern ResourceLocationValues_CLOUD = ResourceLocationValues' "CLOUD"++pattern ResourceLocationValues_OUTPOST :: ResourceLocationValues+pattern ResourceLocationValues_OUTPOST = ResourceLocationValues' "OUTPOST"++{-# COMPLETE+ ResourceLocationValues_CLOUD,+ ResourceLocationValues_OUTPOST,+ ResourceLocationValues'+ #-}
+ gen/Amazonka/DLM/Types/ResourceTypeValues.hs view
@@ -0,0 +1,71 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.ResourceTypeValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.ResourceTypeValues+ ( ResourceTypeValues+ ( ..,+ ResourceTypeValues_INSTANCE,+ ResourceTypeValues_VOLUME+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype ResourceTypeValues = ResourceTypeValues'+ { fromResourceTypeValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern ResourceTypeValues_INSTANCE :: ResourceTypeValues+pattern ResourceTypeValues_INSTANCE = ResourceTypeValues' "INSTANCE"++pattern ResourceTypeValues_VOLUME :: ResourceTypeValues+pattern ResourceTypeValues_VOLUME = ResourceTypeValues' "VOLUME"++{-# COMPLETE+ ResourceTypeValues_INSTANCE,+ ResourceTypeValues_VOLUME,+ ResourceTypeValues'+ #-}
+ gen/Amazonka/DLM/Types/RetainRule.hs view
@@ -0,0 +1,159 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.RetainRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.RetainRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot and AMI policies only]__ Specifies a retention rule for+-- snapshots created by snapshot policies, or for AMIs created by AMI+-- policies.+--+-- For snapshot policies that have an ArchiveRule, this retention rule+-- applies to standard tier retention. When the retention threshold is met,+-- snapshots are moved from the standard to the archive tier.+--+-- For snapshot policies that do not have an __ArchiveRule__, snapshots are+-- permanently deleted when this retention threshold is met.+--+-- You can retain snapshots based on either a count or a time interval.+--+-- - __Count-based retention__+--+-- You must specify __Count__. If you specify an ArchiveRule for the+-- schedule, then you can specify a retention count of @0@ to archive+-- snapshots immediately after creation. If you specify a+-- FastRestoreRule, ShareRule, or a CrossRegionCopyRule, then you must+-- specify a retention count of @1@ or more.+--+-- - __Age-based retention__+--+-- You must specify __Interval__ and __IntervalUnit__. If you specify+-- an ArchiveRule for the schedule, then you can specify a retention+-- interval of @0@ days to archive snapshots immediately after+-- creation. If you specify a FastRestoreRule, ShareRule, or a+-- CrossRegionCopyRule, then you must specify a retention interval of+-- @1@ day or more.+--+-- /See:/ 'newRetainRule' smart constructor.+data RetainRule = RetainRule'+ { -- | The number of snapshots to retain for each volume, up to a maximum of+ -- 1000. For example if you want to retain a maximum of three snapshots,+ -- specify @3@. When the fourth snapshot is created, the oldest retained+ -- snapshot is deleted, or it is moved to the archive tier if you have+ -- specified an ArchiveRule.+ count :: Prelude.Maybe Prelude.Natural,+ -- | The amount of time to retain each snapshot. The maximum is 100 years.+ -- This is equivalent to 1200 months, 5200 weeks, or 36500 days.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time for time-based retention. For example, to retain+ -- snapshots for 3 months, specify @Interval=3@ and @IntervalUnit=MONTHS@.+ -- Once the snapshot has been retained for 3 months, it is deleted, or it+ -- is moved to the archive tier if you have specified an ArchiveRule.+ intervalUnit :: Prelude.Maybe RetentionIntervalUnitValues+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'RetainRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'count', 'retainRule_count' - The number of snapshots to retain for each volume, up to a maximum of+-- 1000. For example if you want to retain a maximum of three snapshots,+-- specify @3@. When the fourth snapshot is created, the oldest retained+-- snapshot is deleted, or it is moved to the archive tier if you have+-- specified an ArchiveRule.+--+-- 'interval', 'retainRule_interval' - The amount of time to retain each snapshot. The maximum is 100 years.+-- This is equivalent to 1200 months, 5200 weeks, or 36500 days.+--+-- 'intervalUnit', 'retainRule_intervalUnit' - The unit of time for time-based retention. For example, to retain+-- snapshots for 3 months, specify @Interval=3@ and @IntervalUnit=MONTHS@.+-- Once the snapshot has been retained for 3 months, it is deleted, or it+-- is moved to the archive tier if you have specified an ArchiveRule.+newRetainRule ::+ RetainRule+newRetainRule =+ RetainRule'+ { count = Prelude.Nothing,+ interval = Prelude.Nothing,+ intervalUnit = Prelude.Nothing+ }++-- | The number of snapshots to retain for each volume, up to a maximum of+-- 1000. For example if you want to retain a maximum of three snapshots,+-- specify @3@. When the fourth snapshot is created, the oldest retained+-- snapshot is deleted, or it is moved to the archive tier if you have+-- specified an ArchiveRule.+retainRule_count :: Lens.Lens' RetainRule (Prelude.Maybe Prelude.Natural)+retainRule_count = Lens.lens (\RetainRule' {count} -> count) (\s@RetainRule' {} a -> s {count = a} :: RetainRule)++-- | The amount of time to retain each snapshot. The maximum is 100 years.+-- This is equivalent to 1200 months, 5200 weeks, or 36500 days.+retainRule_interval :: Lens.Lens' RetainRule (Prelude.Maybe Prelude.Natural)+retainRule_interval = Lens.lens (\RetainRule' {interval} -> interval) (\s@RetainRule' {} a -> s {interval = a} :: RetainRule)++-- | The unit of time for time-based retention. For example, to retain+-- snapshots for 3 months, specify @Interval=3@ and @IntervalUnit=MONTHS@.+-- Once the snapshot has been retained for 3 months, it is deleted, or it+-- is moved to the archive tier if you have specified an ArchiveRule.+retainRule_intervalUnit :: Lens.Lens' RetainRule (Prelude.Maybe RetentionIntervalUnitValues)+retainRule_intervalUnit = Lens.lens (\RetainRule' {intervalUnit} -> intervalUnit) (\s@RetainRule' {} a -> s {intervalUnit = a} :: RetainRule)++instance Data.FromJSON RetainRule where+ parseJSON =+ Data.withObject+ "RetainRule"+ ( \x ->+ RetainRule'+ Prelude.<$> (x Data..:? "Count")+ Prelude.<*> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ )++instance Prelude.Hashable RetainRule where+ hashWithSalt _salt RetainRule' {..} =+ _salt+ `Prelude.hashWithSalt` count+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit++instance Prelude.NFData RetainRule where+ rnf RetainRule' {..} =+ Prelude.rnf count+ `Prelude.seq` Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit++instance Data.ToJSON RetainRule where+ toJSON RetainRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Count" Data..=) Prelude.<$> count,+ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit+ ]+ )
+ gen/Amazonka/DLM/Types/RetentionArchiveTier.hs view
@@ -0,0 +1,140 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.RetentionArchiveTier+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.RetentionArchiveTier where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot policies only]__ Describes the retention rule for archived+-- snapshots. Once the archive retention threshold is met, the snapshots+-- are permanently deleted from the archive tier.+--+-- The archive retention rule must retain snapshots in the archive tier for+-- a minimum of 90 days.+--+-- For __count-based schedules__, you must specify __Count__. For+-- __age-based schedules__, you must specify __Interval__ and+-- __IntervalUnit__.+--+-- For more information about using snapshot archiving, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-ami-policy.html#dlm-archive Considerations for snapshot lifecycle policies>.+--+-- /See:/ 'newRetentionArchiveTier' smart constructor.+data RetentionArchiveTier = RetentionArchiveTier'+ { -- | The maximum number of snapshots to retain in the archive storage tier+ -- for each volume. The count must ensure that each snapshot remains in the+ -- archive tier for at least 90 days. For example, if the schedule creates+ -- snapshots every 30 days, you must specify a count of 3 or more to ensure+ -- that each snapshot is archived for at least 90 days.+ count :: Prelude.Maybe Prelude.Natural,+ -- | Specifies the period of time to retain snapshots in the archive tier.+ -- After this period expires, the snapshot is permanently deleted.+ interval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time in which to measure the __Interval__. For example, to+ -- retain a snapshots in the archive tier for 6 months, specify+ -- @Interval=6@ and @IntervalUnit=MONTHS@.+ intervalUnit :: Prelude.Maybe RetentionIntervalUnitValues+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'RetentionArchiveTier' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'count', 'retentionArchiveTier_count' - The maximum number of snapshots to retain in the archive storage tier+-- for each volume. The count must ensure that each snapshot remains in the+-- archive tier for at least 90 days. For example, if the schedule creates+-- snapshots every 30 days, you must specify a count of 3 or more to ensure+-- that each snapshot is archived for at least 90 days.+--+-- 'interval', 'retentionArchiveTier_interval' - Specifies the period of time to retain snapshots in the archive tier.+-- After this period expires, the snapshot is permanently deleted.+--+-- 'intervalUnit', 'retentionArchiveTier_intervalUnit' - The unit of time in which to measure the __Interval__. For example, to+-- retain a snapshots in the archive tier for 6 months, specify+-- @Interval=6@ and @IntervalUnit=MONTHS@.+newRetentionArchiveTier ::+ RetentionArchiveTier+newRetentionArchiveTier =+ RetentionArchiveTier'+ { count = Prelude.Nothing,+ interval = Prelude.Nothing,+ intervalUnit = Prelude.Nothing+ }++-- | The maximum number of snapshots to retain in the archive storage tier+-- for each volume. The count must ensure that each snapshot remains in the+-- archive tier for at least 90 days. For example, if the schedule creates+-- snapshots every 30 days, you must specify a count of 3 or more to ensure+-- that each snapshot is archived for at least 90 days.+retentionArchiveTier_count :: Lens.Lens' RetentionArchiveTier (Prelude.Maybe Prelude.Natural)+retentionArchiveTier_count = Lens.lens (\RetentionArchiveTier' {count} -> count) (\s@RetentionArchiveTier' {} a -> s {count = a} :: RetentionArchiveTier)++-- | Specifies the period of time to retain snapshots in the archive tier.+-- After this period expires, the snapshot is permanently deleted.+retentionArchiveTier_interval :: Lens.Lens' RetentionArchiveTier (Prelude.Maybe Prelude.Natural)+retentionArchiveTier_interval = Lens.lens (\RetentionArchiveTier' {interval} -> interval) (\s@RetentionArchiveTier' {} a -> s {interval = a} :: RetentionArchiveTier)++-- | The unit of time in which to measure the __Interval__. For example, to+-- retain a snapshots in the archive tier for 6 months, specify+-- @Interval=6@ and @IntervalUnit=MONTHS@.+retentionArchiveTier_intervalUnit :: Lens.Lens' RetentionArchiveTier (Prelude.Maybe RetentionIntervalUnitValues)+retentionArchiveTier_intervalUnit = Lens.lens (\RetentionArchiveTier' {intervalUnit} -> intervalUnit) (\s@RetentionArchiveTier' {} a -> s {intervalUnit = a} :: RetentionArchiveTier)++instance Data.FromJSON RetentionArchiveTier where+ parseJSON =+ Data.withObject+ "RetentionArchiveTier"+ ( \x ->+ RetentionArchiveTier'+ Prelude.<$> (x Data..:? "Count")+ Prelude.<*> (x Data..:? "Interval")+ Prelude.<*> (x Data..:? "IntervalUnit")+ )++instance Prelude.Hashable RetentionArchiveTier where+ hashWithSalt _salt RetentionArchiveTier' {..} =+ _salt+ `Prelude.hashWithSalt` count+ `Prelude.hashWithSalt` interval+ `Prelude.hashWithSalt` intervalUnit++instance Prelude.NFData RetentionArchiveTier where+ rnf RetentionArchiveTier' {..} =+ Prelude.rnf count+ `Prelude.seq` Prelude.rnf interval+ `Prelude.seq` Prelude.rnf intervalUnit++instance Data.ToJSON RetentionArchiveTier where+ toJSON RetentionArchiveTier' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Count" Data..=) Prelude.<$> count,+ ("Interval" Data..=) Prelude.<$> interval,+ ("IntervalUnit" Data..=) Prelude.<$> intervalUnit+ ]+ )
+ gen/Amazonka/DLM/Types/RetentionIntervalUnitValues.hs view
@@ -0,0 +1,81 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.RetentionIntervalUnitValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.RetentionIntervalUnitValues+ ( RetentionIntervalUnitValues+ ( ..,+ RetentionIntervalUnitValues_DAYS,+ RetentionIntervalUnitValues_MONTHS,+ RetentionIntervalUnitValues_WEEKS,+ RetentionIntervalUnitValues_YEARS+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype RetentionIntervalUnitValues = RetentionIntervalUnitValues'+ { fromRetentionIntervalUnitValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern RetentionIntervalUnitValues_DAYS :: RetentionIntervalUnitValues+pattern RetentionIntervalUnitValues_DAYS = RetentionIntervalUnitValues' "DAYS"++pattern RetentionIntervalUnitValues_MONTHS :: RetentionIntervalUnitValues+pattern RetentionIntervalUnitValues_MONTHS = RetentionIntervalUnitValues' "MONTHS"++pattern RetentionIntervalUnitValues_WEEKS :: RetentionIntervalUnitValues+pattern RetentionIntervalUnitValues_WEEKS = RetentionIntervalUnitValues' "WEEKS"++pattern RetentionIntervalUnitValues_YEARS :: RetentionIntervalUnitValues+pattern RetentionIntervalUnitValues_YEARS = RetentionIntervalUnitValues' "YEARS"++{-# COMPLETE+ RetentionIntervalUnitValues_DAYS,+ RetentionIntervalUnitValues_MONTHS,+ RetentionIntervalUnitValues_WEEKS,+ RetentionIntervalUnitValues_YEARS,+ RetentionIntervalUnitValues'+ #-}
+ gen/Amazonka/DLM/Types/Schedule.hs view
@@ -0,0 +1,284 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.Schedule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.Schedule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.ArchiveRule+import Amazonka.DLM.Types.CreateRule+import Amazonka.DLM.Types.CrossRegionCopyRule+import Amazonka.DLM.Types.DeprecateRule+import Amazonka.DLM.Types.FastRestoreRule+import Amazonka.DLM.Types.RetainRule+import Amazonka.DLM.Types.ShareRule+import Amazonka.DLM.Types.Tag+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot and AMI policies only]__ Specifies a schedule for a snapshot+-- or AMI lifecycle policy.+--+-- /See:/ 'newSchedule' smart constructor.+data Schedule = Schedule'+ { -- | __[Snapshot policies that target volumes only]__ The snapshot archiving+ -- rule for the schedule. When you specify an archiving rule, snapshots are+ -- automatically moved from the standard tier to the archive tier once the+ -- schedule\'s retention threshold is met. Snapshots are then retained in+ -- the archive tier for the archive retention period that you specify.+ --+ -- For more information about using snapshot archiving, see+ -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-ami-policy.html#dlm-archive Considerations for snapshot lifecycle policies>.+ archiveRule :: Prelude.Maybe ArchiveRule,+ -- | Copy all user-defined tags on a source volume to snapshots of the volume+ -- created by this policy.+ copyTags :: Prelude.Maybe Prelude.Bool,+ -- | The creation rule.+ createRule :: Prelude.Maybe CreateRule,+ -- | Specifies a rule for copying snapshots or AMIs across regions.+ --+ -- You can\'t specify cross-Region copy rules for policies that create+ -- snapshots on an Outpost. If the policy creates snapshots in a Region,+ -- then snapshots can be copied to up to three Regions or Outposts.+ crossRegionCopyRules :: Prelude.Maybe [CrossRegionCopyRule],+ -- | __[AMI policies only]__ The AMI deprecation rule for the schedule.+ deprecateRule :: Prelude.Maybe DeprecateRule,+ -- | __[Snapshot policies only]__ The rule for enabling fast snapshot+ -- restore.+ fastRestoreRule :: Prelude.Maybe FastRestoreRule,+ -- | The name of the schedule.+ name :: Prelude.Maybe Prelude.Text,+ -- | The retention rule for snapshots or AMIs created by the policy.+ retainRule :: Prelude.Maybe RetainRule,+ -- | __[Snapshot policies only]__ The rule for sharing snapshots with other+ -- Amazon Web Services accounts.+ shareRules :: Prelude.Maybe [ShareRule],+ -- | The tags to apply to policy-created resources. These user-defined tags+ -- are in addition to the Amazon Web Services-added lifecycle tags.+ tagsToAdd :: Prelude.Maybe [Tag],+ -- | __[AMI policies and snapshot policies that target instances only]__ A+ -- collection of key\/value pairs with values determined dynamically when+ -- the policy is executed. Keys may be any valid Amazon EC2 tag key. Values+ -- must be in one of the two following formats: @$(instance-id)@ or+ -- @$(timestamp)@. Variable tags are only valid for EBS Snapshot Management+ -- – Instance policies.+ variableTags :: Prelude.Maybe [Tag]+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'Schedule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'archiveRule', 'schedule_archiveRule' - __[Snapshot policies that target volumes only]__ The snapshot archiving+-- rule for the schedule. When you specify an archiving rule, snapshots are+-- automatically moved from the standard tier to the archive tier once the+-- schedule\'s retention threshold is met. Snapshots are then retained in+-- the archive tier for the archive retention period that you specify.+--+-- For more information about using snapshot archiving, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-ami-policy.html#dlm-archive Considerations for snapshot lifecycle policies>.+--+-- 'copyTags', 'schedule_copyTags' - Copy all user-defined tags on a source volume to snapshots of the volume+-- created by this policy.+--+-- 'createRule', 'schedule_createRule' - The creation rule.+--+-- 'crossRegionCopyRules', 'schedule_crossRegionCopyRules' - Specifies a rule for copying snapshots or AMIs across regions.+--+-- You can\'t specify cross-Region copy rules for policies that create+-- snapshots on an Outpost. If the policy creates snapshots in a Region,+-- then snapshots can be copied to up to three Regions or Outposts.+--+-- 'deprecateRule', 'schedule_deprecateRule' - __[AMI policies only]__ The AMI deprecation rule for the schedule.+--+-- 'fastRestoreRule', 'schedule_fastRestoreRule' - __[Snapshot policies only]__ The rule for enabling fast snapshot+-- restore.+--+-- 'name', 'schedule_name' - The name of the schedule.+--+-- 'retainRule', 'schedule_retainRule' - The retention rule for snapshots or AMIs created by the policy.+--+-- 'shareRules', 'schedule_shareRules' - __[Snapshot policies only]__ The rule for sharing snapshots with other+-- Amazon Web Services accounts.+--+-- 'tagsToAdd', 'schedule_tagsToAdd' - The tags to apply to policy-created resources. These user-defined tags+-- are in addition to the Amazon Web Services-added lifecycle tags.+--+-- 'variableTags', 'schedule_variableTags' - __[AMI policies and snapshot policies that target instances only]__ A+-- collection of key\/value pairs with values determined dynamically when+-- the policy is executed. Keys may be any valid Amazon EC2 tag key. Values+-- must be in one of the two following formats: @$(instance-id)@ or+-- @$(timestamp)@. Variable tags are only valid for EBS Snapshot Management+-- – Instance policies.+newSchedule ::+ Schedule+newSchedule =+ Schedule'+ { archiveRule = Prelude.Nothing,+ copyTags = Prelude.Nothing,+ createRule = Prelude.Nothing,+ crossRegionCopyRules = Prelude.Nothing,+ deprecateRule = Prelude.Nothing,+ fastRestoreRule = Prelude.Nothing,+ name = Prelude.Nothing,+ retainRule = Prelude.Nothing,+ shareRules = Prelude.Nothing,+ tagsToAdd = Prelude.Nothing,+ variableTags = Prelude.Nothing+ }++-- | __[Snapshot policies that target volumes only]__ The snapshot archiving+-- rule for the schedule. When you specify an archiving rule, snapshots are+-- automatically moved from the standard tier to the archive tier once the+-- schedule\'s retention threshold is met. Snapshots are then retained in+-- the archive tier for the archive retention period that you specify.+--+-- For more information about using snapshot archiving, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-ami-policy.html#dlm-archive Considerations for snapshot lifecycle policies>.+schedule_archiveRule :: Lens.Lens' Schedule (Prelude.Maybe ArchiveRule)+schedule_archiveRule = Lens.lens (\Schedule' {archiveRule} -> archiveRule) (\s@Schedule' {} a -> s {archiveRule = a} :: Schedule)++-- | Copy all user-defined tags on a source volume to snapshots of the volume+-- created by this policy.+schedule_copyTags :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Bool)+schedule_copyTags = Lens.lens (\Schedule' {copyTags} -> copyTags) (\s@Schedule' {} a -> s {copyTags = a} :: Schedule)++-- | The creation rule.+schedule_createRule :: Lens.Lens' Schedule (Prelude.Maybe CreateRule)+schedule_createRule = Lens.lens (\Schedule' {createRule} -> createRule) (\s@Schedule' {} a -> s {createRule = a} :: Schedule)++-- | Specifies a rule for copying snapshots or AMIs across regions.+--+-- You can\'t specify cross-Region copy rules for policies that create+-- snapshots on an Outpost. If the policy creates snapshots in a Region,+-- then snapshots can be copied to up to three Regions or Outposts.+schedule_crossRegionCopyRules :: Lens.Lens' Schedule (Prelude.Maybe [CrossRegionCopyRule])+schedule_crossRegionCopyRules = Lens.lens (\Schedule' {crossRegionCopyRules} -> crossRegionCopyRules) (\s@Schedule' {} a -> s {crossRegionCopyRules = a} :: Schedule) Prelude.. Lens.mapping Lens.coerced++-- | __[AMI policies only]__ The AMI deprecation rule for the schedule.+schedule_deprecateRule :: Lens.Lens' Schedule (Prelude.Maybe DeprecateRule)+schedule_deprecateRule = Lens.lens (\Schedule' {deprecateRule} -> deprecateRule) (\s@Schedule' {} a -> s {deprecateRule = a} :: Schedule)++-- | __[Snapshot policies only]__ The rule for enabling fast snapshot+-- restore.+schedule_fastRestoreRule :: Lens.Lens' Schedule (Prelude.Maybe FastRestoreRule)+schedule_fastRestoreRule = Lens.lens (\Schedule' {fastRestoreRule} -> fastRestoreRule) (\s@Schedule' {} a -> s {fastRestoreRule = a} :: Schedule)++-- | The name of the schedule.+schedule_name :: Lens.Lens' Schedule (Prelude.Maybe Prelude.Text)+schedule_name = Lens.lens (\Schedule' {name} -> name) (\s@Schedule' {} a -> s {name = a} :: Schedule)++-- | The retention rule for snapshots or AMIs created by the policy.+schedule_retainRule :: Lens.Lens' Schedule (Prelude.Maybe RetainRule)+schedule_retainRule = Lens.lens (\Schedule' {retainRule} -> retainRule) (\s@Schedule' {} a -> s {retainRule = a} :: Schedule)++-- | __[Snapshot policies only]__ The rule for sharing snapshots with other+-- Amazon Web Services accounts.+schedule_shareRules :: Lens.Lens' Schedule (Prelude.Maybe [ShareRule])+schedule_shareRules = Lens.lens (\Schedule' {shareRules} -> shareRules) (\s@Schedule' {} a -> s {shareRules = a} :: Schedule) Prelude.. Lens.mapping Lens.coerced++-- | The tags to apply to policy-created resources. These user-defined tags+-- are in addition to the Amazon Web Services-added lifecycle tags.+schedule_tagsToAdd :: Lens.Lens' Schedule (Prelude.Maybe [Tag])+schedule_tagsToAdd = Lens.lens (\Schedule' {tagsToAdd} -> tagsToAdd) (\s@Schedule' {} a -> s {tagsToAdd = a} :: Schedule) Prelude.. Lens.mapping Lens.coerced++-- | __[AMI policies and snapshot policies that target instances only]__ A+-- collection of key\/value pairs with values determined dynamically when+-- the policy is executed. Keys may be any valid Amazon EC2 tag key. Values+-- must be in one of the two following formats: @$(instance-id)@ or+-- @$(timestamp)@. Variable tags are only valid for EBS Snapshot Management+-- – Instance policies.+schedule_variableTags :: Lens.Lens' Schedule (Prelude.Maybe [Tag])+schedule_variableTags = Lens.lens (\Schedule' {variableTags} -> variableTags) (\s@Schedule' {} a -> s {variableTags = a} :: Schedule) Prelude.. Lens.mapping Lens.coerced++instance Data.FromJSON Schedule where+ parseJSON =+ Data.withObject+ "Schedule"+ ( \x ->+ Schedule'+ Prelude.<$> (x Data..:? "ArchiveRule")+ Prelude.<*> (x Data..:? "CopyTags")+ Prelude.<*> (x Data..:? "CreateRule")+ Prelude.<*> ( x+ Data..:? "CrossRegionCopyRules"+ Data..!= Prelude.mempty+ )+ Prelude.<*> (x Data..:? "DeprecateRule")+ Prelude.<*> (x Data..:? "FastRestoreRule")+ Prelude.<*> (x Data..:? "Name")+ Prelude.<*> (x Data..:? "RetainRule")+ Prelude.<*> (x Data..:? "ShareRules" Data..!= Prelude.mempty)+ Prelude.<*> (x Data..:? "TagsToAdd" Data..!= Prelude.mempty)+ Prelude.<*> (x Data..:? "VariableTags" Data..!= Prelude.mempty)+ )++instance Prelude.Hashable Schedule where+ hashWithSalt _salt Schedule' {..} =+ _salt+ `Prelude.hashWithSalt` archiveRule+ `Prelude.hashWithSalt` copyTags+ `Prelude.hashWithSalt` createRule+ `Prelude.hashWithSalt` crossRegionCopyRules+ `Prelude.hashWithSalt` deprecateRule+ `Prelude.hashWithSalt` fastRestoreRule+ `Prelude.hashWithSalt` name+ `Prelude.hashWithSalt` retainRule+ `Prelude.hashWithSalt` shareRules+ `Prelude.hashWithSalt` tagsToAdd+ `Prelude.hashWithSalt` variableTags++instance Prelude.NFData Schedule where+ rnf Schedule' {..} =+ Prelude.rnf archiveRule+ `Prelude.seq` Prelude.rnf copyTags+ `Prelude.seq` Prelude.rnf createRule+ `Prelude.seq` Prelude.rnf crossRegionCopyRules+ `Prelude.seq` Prelude.rnf deprecateRule+ `Prelude.seq` Prelude.rnf fastRestoreRule+ `Prelude.seq` Prelude.rnf name+ `Prelude.seq` Prelude.rnf retainRule+ `Prelude.seq` Prelude.rnf shareRules+ `Prelude.seq` Prelude.rnf tagsToAdd+ `Prelude.seq` Prelude.rnf variableTags++instance Data.ToJSON Schedule where+ toJSON Schedule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ArchiveRule" Data..=) Prelude.<$> archiveRule,+ ("CopyTags" Data..=) Prelude.<$> copyTags,+ ("CreateRule" Data..=) Prelude.<$> createRule,+ ("CrossRegionCopyRules" Data..=)+ Prelude.<$> crossRegionCopyRules,+ ("DeprecateRule" Data..=) Prelude.<$> deprecateRule,+ ("FastRestoreRule" Data..=)+ Prelude.<$> fastRestoreRule,+ ("Name" Data..=) Prelude.<$> name,+ ("RetainRule" Data..=) Prelude.<$> retainRule,+ ("ShareRules" Data..=) Prelude.<$> shareRules,+ ("TagsToAdd" Data..=) Prelude.<$> tagsToAdd,+ ("VariableTags" Data..=) Prelude.<$> variableTags+ ]+ )
+ gen/Amazonka/DLM/Types/SettablePolicyStateValues.hs view
@@ -0,0 +1,71 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.SettablePolicyStateValues+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.SettablePolicyStateValues+ ( SettablePolicyStateValues+ ( ..,+ SettablePolicyStateValues_DISABLED,+ SettablePolicyStateValues_ENABLED+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype SettablePolicyStateValues = SettablePolicyStateValues'+ { fromSettablePolicyStateValues ::+ Data.Text+ }+ deriving stock+ ( Prelude.Show,+ Prelude.Read,+ Prelude.Eq,+ Prelude.Ord,+ Prelude.Generic+ )+ deriving newtype+ ( Prelude.Hashable,+ Prelude.NFData,+ Data.FromText,+ Data.ToText,+ Data.ToByteString,+ Data.ToLog,+ Data.ToHeader,+ Data.ToQuery,+ Data.FromJSON,+ Data.FromJSONKey,+ Data.ToJSON,+ Data.ToJSONKey,+ Data.FromXML,+ Data.ToXML+ )++pattern SettablePolicyStateValues_DISABLED :: SettablePolicyStateValues+pattern SettablePolicyStateValues_DISABLED = SettablePolicyStateValues' "DISABLED"++pattern SettablePolicyStateValues_ENABLED :: SettablePolicyStateValues+pattern SettablePolicyStateValues_ENABLED = SettablePolicyStateValues' "ENABLED"++{-# COMPLETE+ SettablePolicyStateValues_DISABLED,+ SettablePolicyStateValues_ENABLED,+ SettablePolicyStateValues'+ #-}
@@ -0,0 +1,120 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.ShareRule+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.ShareRule where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types.RetentionIntervalUnitValues+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | __[Snapshot policies only]__ Specifies a rule for sharing snapshots+-- across Amazon Web Services accounts.+--+-- /See:/ 'newShareRule' smart constructor.+data ShareRule = ShareRule'+ { -- | The period after which snapshots that are shared with other Amazon Web+ -- Services accounts are automatically unshared.+ unshareInterval :: Prelude.Maybe Prelude.Natural,+ -- | The unit of time for the automatic unsharing interval.+ unshareIntervalUnit :: Prelude.Maybe RetentionIntervalUnitValues,+ -- | The IDs of the Amazon Web Services accounts with which to share the+ -- snapshots.+ targetAccounts :: Prelude.NonEmpty Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ShareRule' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'unshareInterval', 'shareRule_unshareInterval' - The period after which snapshots that are shared with other Amazon Web+-- Services accounts are automatically unshared.+--+-- 'unshareIntervalUnit', 'shareRule_unshareIntervalUnit' - The unit of time for the automatic unsharing interval.+--+-- 'targetAccounts', 'shareRule_targetAccounts' - The IDs of the Amazon Web Services accounts with which to share the+-- snapshots.+newShareRule ::+ -- | 'targetAccounts'+ Prelude.NonEmpty Prelude.Text ->+ ShareRule+newShareRule pTargetAccounts_ =+ ShareRule'+ { unshareInterval = Prelude.Nothing,+ unshareIntervalUnit = Prelude.Nothing,+ targetAccounts =+ Lens.coerced Lens.# pTargetAccounts_+ }++-- | The period after which snapshots that are shared with other Amazon Web+-- Services accounts are automatically unshared.+shareRule_unshareInterval :: Lens.Lens' ShareRule (Prelude.Maybe Prelude.Natural)+shareRule_unshareInterval = Lens.lens (\ShareRule' {unshareInterval} -> unshareInterval) (\s@ShareRule' {} a -> s {unshareInterval = a} :: ShareRule)++-- | The unit of time for the automatic unsharing interval.+shareRule_unshareIntervalUnit :: Lens.Lens' ShareRule (Prelude.Maybe RetentionIntervalUnitValues)+shareRule_unshareIntervalUnit = Lens.lens (\ShareRule' {unshareIntervalUnit} -> unshareIntervalUnit) (\s@ShareRule' {} a -> s {unshareIntervalUnit = a} :: ShareRule)++-- | The IDs of the Amazon Web Services accounts with which to share the+-- snapshots.+shareRule_targetAccounts :: Lens.Lens' ShareRule (Prelude.NonEmpty Prelude.Text)+shareRule_targetAccounts = Lens.lens (\ShareRule' {targetAccounts} -> targetAccounts) (\s@ShareRule' {} a -> s {targetAccounts = a} :: ShareRule) Prelude.. Lens.coerced++instance Data.FromJSON ShareRule where+ parseJSON =+ Data.withObject+ "ShareRule"+ ( \x ->+ ShareRule'+ Prelude.<$> (x Data..:? "UnshareInterval")+ Prelude.<*> (x Data..:? "UnshareIntervalUnit")+ Prelude.<*> (x Data..: "TargetAccounts")+ )++instance Prelude.Hashable ShareRule where+ hashWithSalt _salt ShareRule' {..} =+ _salt+ `Prelude.hashWithSalt` unshareInterval+ `Prelude.hashWithSalt` unshareIntervalUnit+ `Prelude.hashWithSalt` targetAccounts++instance Prelude.NFData ShareRule where+ rnf ShareRule' {..} =+ Prelude.rnf unshareInterval+ `Prelude.seq` Prelude.rnf unshareIntervalUnit+ `Prelude.seq` Prelude.rnf targetAccounts++instance Data.ToJSON ShareRule where+ toJSON ShareRule' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("UnshareInterval" Data..=)+ Prelude.<$> unshareInterval,+ ("UnshareIntervalUnit" Data..=)+ Prelude.<$> unshareIntervalUnit,+ Prelude.Just+ ("TargetAccounts" Data..= targetAccounts)+ ]+ )
+ gen/Amazonka/DLM/Types/Tag.hs view
@@ -0,0 +1,93 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Types.Tag+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Types.Tag where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++-- | Specifies a tag for a resource.+--+-- /See:/ 'newTag' smart constructor.+data Tag = Tag'+ { -- | The tag key.+ key :: Prelude.Text,+ -- | The tag value.+ value :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'Tag' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'key', 'tag_key' - The tag key.+--+-- 'value', 'tag_value' - The tag value.+newTag ::+ -- | 'key'+ Prelude.Text ->+ -- | 'value'+ Prelude.Text ->+ Tag+newTag pKey_ pValue_ =+ Tag' {key = pKey_, value = pValue_}++-- | The tag key.+tag_key :: Lens.Lens' Tag Prelude.Text+tag_key = Lens.lens (\Tag' {key} -> key) (\s@Tag' {} a -> s {key = a} :: Tag)++-- | The tag value.+tag_value :: Lens.Lens' Tag Prelude.Text+tag_value = Lens.lens (\Tag' {value} -> value) (\s@Tag' {} a -> s {value = a} :: Tag)++instance Data.FromJSON Tag where+ parseJSON =+ Data.withObject+ "Tag"+ ( \x ->+ Tag'+ Prelude.<$> (x Data..: "Key")+ Prelude.<*> (x Data..: "Value")+ )++instance Prelude.Hashable Tag where+ hashWithSalt _salt Tag' {..} =+ _salt+ `Prelude.hashWithSalt` key+ `Prelude.hashWithSalt` value++instance Prelude.NFData Tag where+ rnf Tag' {..} =+ Prelude.rnf key `Prelude.seq` Prelude.rnf value++instance Data.ToJSON Tag where+ toJSON Tag' {..} =+ Data.object+ ( Prelude.catMaybes+ [ Prelude.Just ("Key" Data..= key),+ Prelude.Just ("Value" Data..= value)+ ]+ )
+ gen/Amazonka/DLM/UntagResource.hs view
@@ -0,0 +1,163 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.UntagResource+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Removes the specified tags from the specified resource.+module Amazonka.DLM.UntagResource+ ( -- * Creating a Request+ UntagResource (..),+ newUntagResource,++ -- * Request Lenses+ untagResource_resourceArn,+ untagResource_tagKeys,++ -- * Destructuring the Response+ UntagResourceResponse (..),+ newUntagResourceResponse,++ -- * Response Lenses+ untagResourceResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newUntagResource' smart constructor.+data UntagResource = UntagResource'+ { -- | The Amazon Resource Name (ARN) of the resource.+ resourceArn :: Prelude.Text,+ -- | The tag keys.+ tagKeys :: Prelude.NonEmpty Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'UntagResource' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'resourceArn', 'untagResource_resourceArn' - The Amazon Resource Name (ARN) of the resource.+--+-- 'tagKeys', 'untagResource_tagKeys' - The tag keys.+newUntagResource ::+ -- | 'resourceArn'+ Prelude.Text ->+ -- | 'tagKeys'+ Prelude.NonEmpty Prelude.Text ->+ UntagResource+newUntagResource pResourceArn_ pTagKeys_ =+ UntagResource'+ { resourceArn = pResourceArn_,+ tagKeys = Lens.coerced Lens.# pTagKeys_+ }++-- | The Amazon Resource Name (ARN) of the resource.+untagResource_resourceArn :: Lens.Lens' UntagResource Prelude.Text+untagResource_resourceArn = Lens.lens (\UntagResource' {resourceArn} -> resourceArn) (\s@UntagResource' {} a -> s {resourceArn = a} :: UntagResource)++-- | The tag keys.+untagResource_tagKeys :: Lens.Lens' UntagResource (Prelude.NonEmpty Prelude.Text)+untagResource_tagKeys = Lens.lens (\UntagResource' {tagKeys} -> tagKeys) (\s@UntagResource' {} a -> s {tagKeys = a} :: UntagResource) Prelude.. Lens.coerced++instance Core.AWSRequest UntagResource where+ type+ AWSResponse UntagResource =+ UntagResourceResponse+ request overrides =+ Request.delete (overrides defaultService)+ response =+ Response.receiveEmpty+ ( \s h x ->+ UntagResourceResponse'+ Prelude.<$> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable UntagResource where+ hashWithSalt _salt UntagResource' {..} =+ _salt+ `Prelude.hashWithSalt` resourceArn+ `Prelude.hashWithSalt` tagKeys++instance Prelude.NFData UntagResource where+ rnf UntagResource' {..} =+ Prelude.rnf resourceArn+ `Prelude.seq` Prelude.rnf tagKeys++instance Data.ToHeaders UntagResource where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToPath UntagResource where+ toPath UntagResource' {..} =+ Prelude.mconcat ["/tags/", Data.toBS resourceArn]++instance Data.ToQuery UntagResource where+ toQuery UntagResource' {..} =+ Prelude.mconcat+ ["tagKeys" Data.=: Data.toQueryList "member" tagKeys]++-- | /See:/ 'newUntagResourceResponse' smart constructor.+data UntagResourceResponse = UntagResourceResponse'+ { -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'UntagResourceResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'httpStatus', 'untagResourceResponse_httpStatus' - The response's http status code.+newUntagResourceResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ UntagResourceResponse+newUntagResourceResponse pHttpStatus_ =+ UntagResourceResponse' {httpStatus = pHttpStatus_}++-- | The response's http status code.+untagResourceResponse_httpStatus :: Lens.Lens' UntagResourceResponse Prelude.Int+untagResourceResponse_httpStatus = Lens.lens (\UntagResourceResponse' {httpStatus} -> httpStatus) (\s@UntagResourceResponse' {} a -> s {httpStatus = a} :: UntagResourceResponse)++instance Prelude.NFData UntagResourceResponse where+ rnf UntagResourceResponse' {..} =+ Prelude.rnf httpStatus
+ gen/Amazonka/DLM/UpdateLifecyclePolicy.hs view
@@ -0,0 +1,220 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.UpdateLifecyclePolicy+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Updates the specified lifecycle policy.+--+-- For more information about updating a policy, see+-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/view-modify-delete.html#modify Modify lifecycle policies>.+module Amazonka.DLM.UpdateLifecyclePolicy+ ( -- * Creating a Request+ UpdateLifecyclePolicy (..),+ newUpdateLifecyclePolicy,++ -- * Request Lenses+ updateLifecyclePolicy_description,+ updateLifecyclePolicy_executionRoleArn,+ updateLifecyclePolicy_policyDetails,+ updateLifecyclePolicy_state,+ updateLifecyclePolicy_policyId,++ -- * Destructuring the Response+ UpdateLifecyclePolicyResponse (..),+ newUpdateLifecyclePolicyResponse,++ -- * Response Lenses+ updateLifecyclePolicyResponse_httpStatus,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newUpdateLifecyclePolicy' smart constructor.+data UpdateLifecyclePolicy = UpdateLifecyclePolicy'+ { -- | A description of the lifecycle policy.+ description :: Prelude.Maybe Prelude.Text,+ -- | The Amazon Resource Name (ARN) of the IAM role used to run the+ -- operations specified by the lifecycle policy.+ executionRoleArn :: Prelude.Maybe Prelude.Text,+ -- | The configuration of the lifecycle policy. You cannot update the policy+ -- type or the resource type.+ policyDetails :: Prelude.Maybe PolicyDetails,+ -- | The desired activation state of the lifecycle policy after creation.+ state :: Prelude.Maybe SettablePolicyStateValues,+ -- | The identifier of the lifecycle policy.+ policyId :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'UpdateLifecyclePolicy' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'description', 'updateLifecyclePolicy_description' - A description of the lifecycle policy.+--+-- 'executionRoleArn', 'updateLifecyclePolicy_executionRoleArn' - The Amazon Resource Name (ARN) of the IAM role used to run the+-- operations specified by the lifecycle policy.+--+-- 'policyDetails', 'updateLifecyclePolicy_policyDetails' - The configuration of the lifecycle policy. You cannot update the policy+-- type or the resource type.+--+-- 'state', 'updateLifecyclePolicy_state' - The desired activation state of the lifecycle policy after creation.+--+-- 'policyId', 'updateLifecyclePolicy_policyId' - The identifier of the lifecycle policy.+newUpdateLifecyclePolicy ::+ -- | 'policyId'+ Prelude.Text ->+ UpdateLifecyclePolicy+newUpdateLifecyclePolicy pPolicyId_ =+ UpdateLifecyclePolicy'+ { description =+ Prelude.Nothing,+ executionRoleArn = Prelude.Nothing,+ policyDetails = Prelude.Nothing,+ state = Prelude.Nothing,+ policyId = pPolicyId_+ }++-- | A description of the lifecycle policy.+updateLifecyclePolicy_description :: Lens.Lens' UpdateLifecyclePolicy (Prelude.Maybe Prelude.Text)+updateLifecyclePolicy_description = Lens.lens (\UpdateLifecyclePolicy' {description} -> description) (\s@UpdateLifecyclePolicy' {} a -> s {description = a} :: UpdateLifecyclePolicy)++-- | The Amazon Resource Name (ARN) of the IAM role used to run the+-- operations specified by the lifecycle policy.+updateLifecyclePolicy_executionRoleArn :: Lens.Lens' UpdateLifecyclePolicy (Prelude.Maybe Prelude.Text)+updateLifecyclePolicy_executionRoleArn = Lens.lens (\UpdateLifecyclePolicy' {executionRoleArn} -> executionRoleArn) (\s@UpdateLifecyclePolicy' {} a -> s {executionRoleArn = a} :: UpdateLifecyclePolicy)++-- | The configuration of the lifecycle policy. You cannot update the policy+-- type or the resource type.+updateLifecyclePolicy_policyDetails :: Lens.Lens' UpdateLifecyclePolicy (Prelude.Maybe PolicyDetails)+updateLifecyclePolicy_policyDetails = Lens.lens (\UpdateLifecyclePolicy' {policyDetails} -> policyDetails) (\s@UpdateLifecyclePolicy' {} a -> s {policyDetails = a} :: UpdateLifecyclePolicy)++-- | The desired activation state of the lifecycle policy after creation.+updateLifecyclePolicy_state :: Lens.Lens' UpdateLifecyclePolicy (Prelude.Maybe SettablePolicyStateValues)+updateLifecyclePolicy_state = Lens.lens (\UpdateLifecyclePolicy' {state} -> state) (\s@UpdateLifecyclePolicy' {} a -> s {state = a} :: UpdateLifecyclePolicy)++-- | The identifier of the lifecycle policy.+updateLifecyclePolicy_policyId :: Lens.Lens' UpdateLifecyclePolicy Prelude.Text+updateLifecyclePolicy_policyId = Lens.lens (\UpdateLifecyclePolicy' {policyId} -> policyId) (\s@UpdateLifecyclePolicy' {} a -> s {policyId = a} :: UpdateLifecyclePolicy)++instance Core.AWSRequest UpdateLifecyclePolicy where+ type+ AWSResponse UpdateLifecyclePolicy =+ UpdateLifecyclePolicyResponse+ request overrides =+ Request.patchJSON (overrides defaultService)+ response =+ Response.receiveEmpty+ ( \s h x ->+ UpdateLifecyclePolicyResponse'+ Prelude.<$> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable UpdateLifecyclePolicy where+ hashWithSalt _salt UpdateLifecyclePolicy' {..} =+ _salt+ `Prelude.hashWithSalt` description+ `Prelude.hashWithSalt` executionRoleArn+ `Prelude.hashWithSalt` policyDetails+ `Prelude.hashWithSalt` state+ `Prelude.hashWithSalt` policyId++instance Prelude.NFData UpdateLifecyclePolicy where+ rnf UpdateLifecyclePolicy' {..} =+ Prelude.rnf description+ `Prelude.seq` Prelude.rnf executionRoleArn+ `Prelude.seq` Prelude.rnf policyDetails+ `Prelude.seq` Prelude.rnf state+ `Prelude.seq` Prelude.rnf policyId++instance Data.ToHeaders UpdateLifecyclePolicy where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON UpdateLifecyclePolicy where+ toJSON UpdateLifecyclePolicy' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("Description" Data..=) Prelude.<$> description,+ ("ExecutionRoleArn" Data..=)+ Prelude.<$> executionRoleArn,+ ("PolicyDetails" Data..=) Prelude.<$> policyDetails,+ ("State" Data..=) Prelude.<$> state+ ]+ )++instance Data.ToPath UpdateLifecyclePolicy where+ toPath UpdateLifecyclePolicy' {..} =+ Prelude.mconcat ["/policies/", Data.toBS policyId]++instance Data.ToQuery UpdateLifecyclePolicy where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newUpdateLifecyclePolicyResponse' smart constructor.+data UpdateLifecyclePolicyResponse = UpdateLifecyclePolicyResponse'+ { -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'UpdateLifecyclePolicyResponse' with all optional fields omitted.+--+-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.+--+-- The following record fields are available, with the corresponding lenses provided+-- for backwards compatibility:+--+-- 'httpStatus', 'updateLifecyclePolicyResponse_httpStatus' - The response's http status code.+newUpdateLifecyclePolicyResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ UpdateLifecyclePolicyResponse+newUpdateLifecyclePolicyResponse pHttpStatus_ =+ UpdateLifecyclePolicyResponse'+ { httpStatus =+ pHttpStatus_+ }++-- | The response's http status code.+updateLifecyclePolicyResponse_httpStatus :: Lens.Lens' UpdateLifecyclePolicyResponse Prelude.Int+updateLifecyclePolicyResponse_httpStatus = Lens.lens (\UpdateLifecyclePolicyResponse' {httpStatus} -> httpStatus) (\s@UpdateLifecyclePolicyResponse' {} a -> s {httpStatus = a} :: UpdateLifecyclePolicyResponse)++instance Prelude.NFData UpdateLifecyclePolicyResponse where+ rnf UpdateLifecyclePolicyResponse' {..} =+ Prelude.rnf httpStatus
+ gen/Amazonka/DLM/Waiters.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE DisambiguateRecordFields #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Amazonka.DLM.Waiters+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Amazonka.DLM.Waiters where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import Amazonka.DLM.Lens+import Amazonka.DLM.Types+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude
+ src/.gitkeep view
+ test/Main.hs view
@@ -0,0 +1,23 @@+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Main+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Main (main) where++import Test.Amazonka.DLM+import Test.Amazonka.DLM.Internal+import Test.Tasty++main :: IO ()+main =+ defaultMain $+ testGroup+ "DLM"+ [ testGroup "tests" tests,+ testGroup "fixtures" fixtures+ ]
+ test/Test/Amazonka/DLM.hs view
@@ -0,0 +1,20 @@+-- |+-- Module : Test.Amazonka.DLM+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Test.Amazonka.DLM+ ( tests,+ fixtures,+ )+where++import Test.Tasty (TestTree)++tests :: [TestTree]+tests = []++fixtures :: [TestTree]+fixtures = []
+ test/Test/Amazonka/DLM/Internal.hs view
@@ -0,0 +1,8 @@+-- |+-- Module : Test.Amazonka.DLM.Internal+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Test.Amazonka.DLM.Internal where
+ test/Test/Amazonka/Gen/DLM.hs view
@@ -0,0 +1,198 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- |+-- Module : Test.Amazonka.Gen.DLM+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Test.Amazonka.Gen.DLM where++import Amazonka.DLM+import qualified Data.Proxy as Proxy+import Test.Amazonka.DLM.Internal+import Test.Amazonka.Fixture+import Test.Amazonka.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"+-- [ requestCreateLifecyclePolicy $+-- newCreateLifecyclePolicy+--+-- , requestDeleteLifecyclePolicy $+-- newDeleteLifecyclePolicy+--+-- , requestGetLifecyclePolicies $+-- newGetLifecyclePolicies+--+-- , requestGetLifecyclePolicy $+-- newGetLifecyclePolicy+--+-- , requestListTagsForResource $+-- newListTagsForResource+--+-- , requestTagResource $+-- newTagResource+--+-- , requestUntagResource $+-- newUntagResource+--+-- , requestUpdateLifecyclePolicy $+-- newUpdateLifecyclePolicy+--+-- ]++-- , testGroup "response"+-- [ responseCreateLifecyclePolicy $+-- newCreateLifecyclePolicyResponse+--+-- , responseDeleteLifecyclePolicy $+-- newDeleteLifecyclePolicyResponse+--+-- , responseGetLifecyclePolicies $+-- newGetLifecyclePoliciesResponse+--+-- , responseGetLifecyclePolicy $+-- newGetLifecyclePolicyResponse+--+-- , responseListTagsForResource $+-- newListTagsForResourceResponse+--+-- , responseTagResource $+-- newTagResourceResponse+--+-- , responseUntagResource $+-- newUntagResourceResponse+--+-- , responseUpdateLifecyclePolicy $+-- newUpdateLifecyclePolicyResponse+--+-- ]+-- ]++-- Requests++requestCreateLifecyclePolicy :: CreateLifecyclePolicy -> TestTree+requestCreateLifecyclePolicy =+ req+ "CreateLifecyclePolicy"+ "fixture/CreateLifecyclePolicy.yaml"++requestDeleteLifecyclePolicy :: DeleteLifecyclePolicy -> TestTree+requestDeleteLifecyclePolicy =+ req+ "DeleteLifecyclePolicy"+ "fixture/DeleteLifecyclePolicy.yaml"++requestGetLifecyclePolicies :: GetLifecyclePolicies -> TestTree+requestGetLifecyclePolicies =+ req+ "GetLifecyclePolicies"+ "fixture/GetLifecyclePolicies.yaml"++requestGetLifecyclePolicy :: GetLifecyclePolicy -> TestTree+requestGetLifecyclePolicy =+ req+ "GetLifecyclePolicy"+ "fixture/GetLifecyclePolicy.yaml"++requestListTagsForResource :: ListTagsForResource -> TestTree+requestListTagsForResource =+ req+ "ListTagsForResource"+ "fixture/ListTagsForResource.yaml"++requestTagResource :: TagResource -> TestTree+requestTagResource =+ req+ "TagResource"+ "fixture/TagResource.yaml"++requestUntagResource :: UntagResource -> TestTree+requestUntagResource =+ req+ "UntagResource"+ "fixture/UntagResource.yaml"++requestUpdateLifecyclePolicy :: UpdateLifecyclePolicy -> TestTree+requestUpdateLifecyclePolicy =+ req+ "UpdateLifecyclePolicy"+ "fixture/UpdateLifecyclePolicy.yaml"++-- Responses++responseCreateLifecyclePolicy :: CreateLifecyclePolicyResponse -> TestTree+responseCreateLifecyclePolicy =+ res+ "CreateLifecyclePolicyResponse"+ "fixture/CreateLifecyclePolicyResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy CreateLifecyclePolicy)++responseDeleteLifecyclePolicy :: DeleteLifecyclePolicyResponse -> TestTree+responseDeleteLifecyclePolicy =+ res+ "DeleteLifecyclePolicyResponse"+ "fixture/DeleteLifecyclePolicyResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy DeleteLifecyclePolicy)++responseGetLifecyclePolicies :: GetLifecyclePoliciesResponse -> TestTree+responseGetLifecyclePolicies =+ res+ "GetLifecyclePoliciesResponse"+ "fixture/GetLifecyclePoliciesResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy GetLifecyclePolicies)++responseGetLifecyclePolicy :: GetLifecyclePolicyResponse -> TestTree+responseGetLifecyclePolicy =+ res+ "GetLifecyclePolicyResponse"+ "fixture/GetLifecyclePolicyResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy GetLifecyclePolicy)++responseListTagsForResource :: ListTagsForResourceResponse -> TestTree+responseListTagsForResource =+ res+ "ListTagsForResourceResponse"+ "fixture/ListTagsForResourceResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy ListTagsForResource)++responseTagResource :: TagResourceResponse -> TestTree+responseTagResource =+ res+ "TagResourceResponse"+ "fixture/TagResourceResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy TagResource)++responseUntagResource :: UntagResourceResponse -> TestTree+responseUntagResource =+ res+ "UntagResourceResponse"+ "fixture/UntagResourceResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy UntagResource)++responseUpdateLifecyclePolicy :: UpdateLifecyclePolicyResponse -> TestTree+responseUpdateLifecyclePolicy =+ res+ "UpdateLifecyclePolicyResponse"+ "fixture/UpdateLifecyclePolicyResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy UpdateLifecyclePolicy)