amazonka-redshift-data (empty) → 2.0
raw patch · 50 files changed
+6595/−0 lines, 50 filesdep +amazonka-coredep +amazonka-redshift-datadep +amazonka-test
Dependencies added: amazonka-core, amazonka-redshift-data, amazonka-test, base, bytestring, case-insensitive, tasty, tasty-hunit, text, time, unordered-containers
Files
- LICENSE +367/−0
- README.md +44/−0
- amazonka-redshift-data.cabal +101/−0
- fixture/BatchExecuteStatement.yaml +10/−0
- fixture/BatchExecuteStatementResponse.proto +0/−0
- fixture/CancelStatement.yaml +10/−0
- fixture/CancelStatementResponse.proto +0/−0
- fixture/DescribeStatement.yaml +10/−0
- fixture/DescribeStatementResponse.proto +0/−0
- fixture/DescribeTable.yaml +10/−0
- fixture/DescribeTableResponse.proto +0/−0
- fixture/ExecuteStatement.yaml +10/−0
- fixture/ExecuteStatementResponse.proto +0/−0
- fixture/GetStatementResult.yaml +10/−0
- fixture/GetStatementResultResponse.proto +0/−0
- fixture/ListDatabases.yaml +10/−0
- fixture/ListDatabasesResponse.proto +0/−0
- fixture/ListSchemas.yaml +10/−0
- fixture/ListSchemasResponse.proto +0/−0
- fixture/ListStatements.yaml +10/−0
- fixture/ListStatementsResponse.proto +0/−0
- fixture/ListTables.yaml +10/−0
- fixture/ListTablesResponse.proto +0/−0
- gen/Amazonka/RedshiftData.hs +189/−0
- gen/Amazonka/RedshiftData/BatchExecuteStatement.hs +424/−0
- gen/Amazonka/RedshiftData/CancelStatement.hs +178/−0
- gen/Amazonka/RedshiftData/DescribeStatement.hs +497/−0
- gen/Amazonka/RedshiftData/DescribeTable.hs +431/−0
- gen/Amazonka/RedshiftData/ExecuteStatement.hs +428/−0
- gen/Amazonka/RedshiftData/GetStatementResult.hs +302/−0
- gen/Amazonka/RedshiftData/Lens.hs +236/−0
- gen/Amazonka/RedshiftData/ListDatabases.hs +362/−0
- gen/Amazonka/RedshiftData/ListSchemas.hs +402/−0
- gen/Amazonka/RedshiftData/ListStatements.hs +373/−0
- gen/Amazonka/RedshiftData/ListTables.hs +441/−0
- gen/Amazonka/RedshiftData/Types.hs +236/−0
- gen/Amazonka/RedshiftData/Types/ColumnMetadata.hs +216/−0
- gen/Amazonka/RedshiftData/Types/Field.hs +140/−0
- gen/Amazonka/RedshiftData/Types/SqlParameter.hs +102/−0
- gen/Amazonka/RedshiftData/Types/StatementData.hs +196/−0
- gen/Amazonka/RedshiftData/Types/StatementStatusString.hs +91/−0
- gen/Amazonka/RedshiftData/Types/StatusString.hs +96/−0
- gen/Amazonka/RedshiftData/Types/SubStatementData.hs +231/−0
- gen/Amazonka/RedshiftData/Types/TableMember.hs +99/−0
- gen/Amazonka/RedshiftData/Waiters.hs +24/−0
- src/.gitkeep +0/−0
- test/Main.hs +23/−0
- test/Test/Amazonka/Gen/RedshiftData.hs +238/−0
- test/Test/Amazonka/RedshiftData.hs +20/−0
- test/Test/Amazonka/RedshiftData/Internal.hs +8/−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 Redshift Data API Service SDK++* [Version](#version)+* [Description](#description)+* [Contribute](#contribute)+* [Licence](#licence)+++## Version+ +`2.0` - Derived from API version @2019-12-20@ of the AWS service descriptions, licensed under Apache 2.0.++## Description++Documentation is available via [Hackage](http://hackage.haskell.org/package/amazonka-redshift-data)+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.RedshiftData](http://hackage.haskell.org/package/amazonka-redshift-data/docs/Amazonka-RedshiftData.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-redshift-data` 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-redshift-data.cabal view
@@ -0,0 +1,101 @@+cabal-version: 2.2+name: amazonka-redshift-data+version: 2.0+synopsis: Amazon Redshift Data API Service SDK.+homepage: https://github.com/brendanhay/amazonka+bug-reports: https://github.com/brendanhay/amazonka/issues+license: MPL-2.0+license-file: LICENSE+author: Brendan Hay+maintainer:+ Brendan Hay <brendan.g.hay+amazonka@gmail.com>, 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 @2019-12-20@ 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.RedshiftData.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.RedshiftData" 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-redshift-data++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.RedshiftData+ Amazonka.RedshiftData.BatchExecuteStatement+ Amazonka.RedshiftData.CancelStatement+ Amazonka.RedshiftData.DescribeStatement+ Amazonka.RedshiftData.DescribeTable+ Amazonka.RedshiftData.ExecuteStatement+ Amazonka.RedshiftData.GetStatementResult+ Amazonka.RedshiftData.Lens+ Amazonka.RedshiftData.ListDatabases+ Amazonka.RedshiftData.ListSchemas+ Amazonka.RedshiftData.ListStatements+ Amazonka.RedshiftData.ListTables+ Amazonka.RedshiftData.Types+ Amazonka.RedshiftData.Types.ColumnMetadata+ Amazonka.RedshiftData.Types.Field+ Amazonka.RedshiftData.Types.SqlParameter+ Amazonka.RedshiftData.Types.StatementData+ Amazonka.RedshiftData.Types.StatementStatusString+ Amazonka.RedshiftData.Types.StatusString+ Amazonka.RedshiftData.Types.SubStatementData+ Amazonka.RedshiftData.Types.TableMember+ Amazonka.RedshiftData.Waiters++ build-depends:+ , amazonka-core >=2.0 && <2.1+ , base >=4.12 && <5++test-suite amazonka-redshift-data-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.Gen.RedshiftData+ Test.Amazonka.RedshiftData+ Test.Amazonka.RedshiftData.Internal++ build-depends:+ , amazonka-core >=2.0 && <2.1+ , amazonka-redshift-data+ , amazonka-test >=2.0 && <2.1+ , base+ , bytestring+ , case-insensitive+ , tasty+ , tasty-hunit+ , text+ , time+ , unordered-containers
+ fixture/BatchExecuteStatement.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/BatchExecuteStatementResponse.proto view
+ fixture/CancelStatement.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/CancelStatementResponse.proto view
+ fixture/DescribeStatement.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/DescribeStatementResponse.proto view
+ fixture/DescribeTable.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/DescribeTableResponse.proto view
+ fixture/ExecuteStatement.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/ExecuteStatementResponse.proto view
+ fixture/GetStatementResult.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/GetStatementResultResponse.proto view
+ fixture/ListDatabases.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/ListDatabasesResponse.proto view
+ fixture/ListSchemas.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/ListSchemasResponse.proto view
+ fixture/ListStatements.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/ListStatementsResponse.proto view
+ fixture/ListTables.yaml view
@@ -0,0 +1,10 @@+---+method: POST+headers:+ Authorization: AWS4-HMAC-SHA256 Credential=access/20091028/us-east-1/redshift-data/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=?+ Host: redshift-data.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/ListTablesResponse.proto view
+ gen/Amazonka/RedshiftData.hs view
@@ -0,0 +1,189 @@+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- |+-- Module : Amazonka.RedshiftData+-- 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 @2019-12-20@ of the AWS service descriptions, licensed under Apache 2.0.+--+-- You can use the Amazon Redshift Data API to run queries on Amazon+-- Redshift tables. You can run SQL statements, which are committed if the+-- statement succeeds.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+module Amazonka.RedshiftData+ ( -- * Service Configuration+ defaultService,++ -- * Errors+ -- $errors++ -- ** ActiveStatementsExceededException+ _ActiveStatementsExceededException,++ -- ** BatchExecuteStatementException+ _BatchExecuteStatementException,++ -- ** DatabaseConnectionException+ _DatabaseConnectionException,++ -- ** ExecuteStatementException+ _ExecuteStatementException,++ -- ** InternalServerException+ _InternalServerException,++ -- ** ResourceNotFoundException+ _ResourceNotFoundException,++ -- ** ValidationException+ _ValidationException,++ -- * Waiters+ -- $waiters++ -- * Operations+ -- $operations++ -- ** BatchExecuteStatement+ BatchExecuteStatement (BatchExecuteStatement'),+ newBatchExecuteStatement,+ BatchExecuteStatementResponse (BatchExecuteStatementResponse'),+ newBatchExecuteStatementResponse,++ -- ** CancelStatement+ CancelStatement (CancelStatement'),+ newCancelStatement,+ CancelStatementResponse (CancelStatementResponse'),+ newCancelStatementResponse,++ -- ** DescribeStatement+ DescribeStatement (DescribeStatement'),+ newDescribeStatement,+ DescribeStatementResponse (DescribeStatementResponse'),+ newDescribeStatementResponse,++ -- ** DescribeTable (Paginated)+ DescribeTable (DescribeTable'),+ newDescribeTable,+ DescribeTableResponse (DescribeTableResponse'),+ newDescribeTableResponse,++ -- ** ExecuteStatement+ ExecuteStatement (ExecuteStatement'),+ newExecuteStatement,+ ExecuteStatementResponse (ExecuteStatementResponse'),+ newExecuteStatementResponse,++ -- ** GetStatementResult (Paginated)+ GetStatementResult (GetStatementResult'),+ newGetStatementResult,+ GetStatementResultResponse (GetStatementResultResponse'),+ newGetStatementResultResponse,++ -- ** ListDatabases (Paginated)+ ListDatabases (ListDatabases'),+ newListDatabases,+ ListDatabasesResponse (ListDatabasesResponse'),+ newListDatabasesResponse,++ -- ** ListSchemas (Paginated)+ ListSchemas (ListSchemas'),+ newListSchemas,+ ListSchemasResponse (ListSchemasResponse'),+ newListSchemasResponse,++ -- ** ListStatements (Paginated)+ ListStatements (ListStatements'),+ newListStatements,+ ListStatementsResponse (ListStatementsResponse'),+ newListStatementsResponse,++ -- ** ListTables (Paginated)+ ListTables (ListTables'),+ newListTables,+ ListTablesResponse (ListTablesResponse'),+ newListTablesResponse,++ -- * Types++ -- ** StatementStatusString+ StatementStatusString (..),++ -- ** StatusString+ StatusString (..),++ -- ** ColumnMetadata+ ColumnMetadata (ColumnMetadata'),+ newColumnMetadata,++ -- ** Field+ Field (Field'),+ newField,++ -- ** SqlParameter+ SqlParameter (SqlParameter'),+ newSqlParameter,++ -- ** StatementData+ StatementData (StatementData'),+ newStatementData,++ -- ** SubStatementData+ SubStatementData (SubStatementData'),+ newSubStatementData,++ -- ** TableMember+ TableMember (TableMember'),+ newTableMember,+ )+where++import Amazonka.RedshiftData.BatchExecuteStatement+import Amazonka.RedshiftData.CancelStatement+import Amazonka.RedshiftData.DescribeStatement+import Amazonka.RedshiftData.DescribeTable+import Amazonka.RedshiftData.ExecuteStatement+import Amazonka.RedshiftData.GetStatementResult+import Amazonka.RedshiftData.Lens+import Amazonka.RedshiftData.ListDatabases+import Amazonka.RedshiftData.ListSchemas+import Amazonka.RedshiftData.ListStatements+import Amazonka.RedshiftData.ListTables+import Amazonka.RedshiftData.Types+import Amazonka.RedshiftData.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 'RedshiftData'.++-- $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/RedshiftData/BatchExecuteStatement.hs view
@@ -0,0 +1,424 @@+{-# 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.RedshiftData.BatchExecuteStatement+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Runs one or more SQL statements, which can be data manipulation language+-- (DML) or data definition language (DDL). Depending on the authorization+-- method, use one of the following combinations of request parameters:+--+-- - Secrets Manager - when connecting to a cluster, specify the Amazon+-- Resource Name (ARN) of the secret, the database name, and the+-- cluster identifier that matches the cluster in the secret. When+-- connecting to a serverless workgroup, specify the Amazon Resource+-- Name (ARN) of the secret and the database name.+--+-- - Temporary credentials - when connecting to a cluster, specify the+-- cluster identifier, the database name, and the database user name.+-- Also, permission to call the @redshift:GetClusterCredentials@+-- operation is required. When connecting to a serverless workgroup,+-- specify the workgroup name and database name. Also, permission to+-- call the @redshift-serverless:GetCredentials@ operation is required.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+module Amazonka.RedshiftData.BatchExecuteStatement+ ( -- * Creating a Request+ BatchExecuteStatement (..),+ newBatchExecuteStatement,++ -- * Request Lenses+ batchExecuteStatement_clientToken,+ batchExecuteStatement_clusterIdentifier,+ batchExecuteStatement_dbUser,+ batchExecuteStatement_secretArn,+ batchExecuteStatement_statementName,+ batchExecuteStatement_withEvent,+ batchExecuteStatement_workgroupName,+ batchExecuteStatement_database,+ batchExecuteStatement_sqls,++ -- * Destructuring the Response+ BatchExecuteStatementResponse (..),+ newBatchExecuteStatementResponse,++ -- * Response Lenses+ batchExecuteStatementResponse_clusterIdentifier,+ batchExecuteStatementResponse_createdAt,+ batchExecuteStatementResponse_database,+ batchExecuteStatementResponse_dbUser,+ batchExecuteStatementResponse_id,+ batchExecuteStatementResponse_secretArn,+ batchExecuteStatementResponse_workgroupName,+ batchExecuteStatementResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newBatchExecuteStatement' smart constructor.+data BatchExecuteStatement = BatchExecuteStatement'+ { -- | A unique, case-sensitive identifier that you provide to ensure the+ -- idempotency of the request.+ clientToken :: Prelude.Maybe Prelude.Text,+ -- | The cluster identifier. This parameter is required when connecting to a+ -- cluster and authenticating using either Secrets Manager or temporary+ -- credentials.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | The database user name. This parameter is required when connecting to a+ -- cluster and authenticating using temporary credentials.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database. This+ -- parameter is required when authenticating using Secrets Manager.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The name of the SQL statements. You can name the SQL statements when you+ -- create them to identify the query.+ statementName :: Prelude.Maybe Prelude.Text,+ -- | A value that indicates whether to send an event to the Amazon+ -- EventBridge event bus after the SQL statements run.+ withEvent :: Prelude.Maybe Prelude.Bool,+ -- | The serverless workgroup name. This parameter is required when+ -- connecting to a serverless workgroup and authenticating using either+ -- Secrets Manager or temporary credentials.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The name of the database. This parameter is required when authenticating+ -- using either Secrets Manager or temporary credentials.+ database :: Prelude.Text,+ -- | One or more SQL statements to run.+ --+ -- > The SQL statements are run as a single transaction. They run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. If any SQL statement fails, then because they are run as one transaction, all work is rolled back.</p>+ sqls :: Prelude.NonEmpty Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'BatchExecuteStatement' 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:+--+-- 'clientToken', 'batchExecuteStatement_clientToken' - A unique, case-sensitive identifier that you provide to ensure the+-- idempotency of the request.+--+-- 'clusterIdentifier', 'batchExecuteStatement_clusterIdentifier' - The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+--+-- 'dbUser', 'batchExecuteStatement_dbUser' - The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+--+-- 'secretArn', 'batchExecuteStatement_secretArn' - The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+--+-- 'statementName', 'batchExecuteStatement_statementName' - The name of the SQL statements. You can name the SQL statements when you+-- create them to identify the query.+--+-- 'withEvent', 'batchExecuteStatement_withEvent' - A value that indicates whether to send an event to the Amazon+-- EventBridge event bus after the SQL statements run.+--+-- 'workgroupName', 'batchExecuteStatement_workgroupName' - The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+--+-- 'database', 'batchExecuteStatement_database' - The name of the database. This parameter is required when authenticating+-- using either Secrets Manager or temporary credentials.+--+-- 'sqls', 'batchExecuteStatement_sqls' - One or more SQL statements to run.+--+-- > The SQL statements are run as a single transaction. They run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. If any SQL statement fails, then because they are run as one transaction, all work is rolled back.</p>+newBatchExecuteStatement ::+ -- | 'database'+ Prelude.Text ->+ -- | 'sqls'+ Prelude.NonEmpty Prelude.Text ->+ BatchExecuteStatement+newBatchExecuteStatement pDatabase_ pSqls_ =+ BatchExecuteStatement'+ { clientToken =+ Prelude.Nothing,+ clusterIdentifier = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ statementName = Prelude.Nothing,+ withEvent = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ database = pDatabase_,+ sqls = Lens.coerced Lens.# pSqls_+ }++-- | A unique, case-sensitive identifier that you provide to ensure the+-- idempotency of the request.+batchExecuteStatement_clientToken :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Text)+batchExecuteStatement_clientToken = Lens.lens (\BatchExecuteStatement' {clientToken} -> clientToken) (\s@BatchExecuteStatement' {} a -> s {clientToken = a} :: BatchExecuteStatement)++-- | The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+batchExecuteStatement_clusterIdentifier :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Text)+batchExecuteStatement_clusterIdentifier = Lens.lens (\BatchExecuteStatement' {clusterIdentifier} -> clusterIdentifier) (\s@BatchExecuteStatement' {} a -> s {clusterIdentifier = a} :: BatchExecuteStatement)++-- | The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+batchExecuteStatement_dbUser :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Text)+batchExecuteStatement_dbUser = Lens.lens (\BatchExecuteStatement' {dbUser} -> dbUser) (\s@BatchExecuteStatement' {} a -> s {dbUser = a} :: BatchExecuteStatement)++-- | The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+batchExecuteStatement_secretArn :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Text)+batchExecuteStatement_secretArn = Lens.lens (\BatchExecuteStatement' {secretArn} -> secretArn) (\s@BatchExecuteStatement' {} a -> s {secretArn = a} :: BatchExecuteStatement)++-- | The name of the SQL statements. You can name the SQL statements when you+-- create them to identify the query.+batchExecuteStatement_statementName :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Text)+batchExecuteStatement_statementName = Lens.lens (\BatchExecuteStatement' {statementName} -> statementName) (\s@BatchExecuteStatement' {} a -> s {statementName = a} :: BatchExecuteStatement)++-- | A value that indicates whether to send an event to the Amazon+-- EventBridge event bus after the SQL statements run.+batchExecuteStatement_withEvent :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Bool)+batchExecuteStatement_withEvent = Lens.lens (\BatchExecuteStatement' {withEvent} -> withEvent) (\s@BatchExecuteStatement' {} a -> s {withEvent = a} :: BatchExecuteStatement)++-- | The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+batchExecuteStatement_workgroupName :: Lens.Lens' BatchExecuteStatement (Prelude.Maybe Prelude.Text)+batchExecuteStatement_workgroupName = Lens.lens (\BatchExecuteStatement' {workgroupName} -> workgroupName) (\s@BatchExecuteStatement' {} a -> s {workgroupName = a} :: BatchExecuteStatement)++-- | The name of the database. This parameter is required when authenticating+-- using either Secrets Manager or temporary credentials.+batchExecuteStatement_database :: Lens.Lens' BatchExecuteStatement Prelude.Text+batchExecuteStatement_database = Lens.lens (\BatchExecuteStatement' {database} -> database) (\s@BatchExecuteStatement' {} a -> s {database = a} :: BatchExecuteStatement)++-- | One or more SQL statements to run.+--+-- > The SQL statements are run as a single transaction. They run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. If any SQL statement fails, then because they are run as one transaction, all work is rolled back.</p>+batchExecuteStatement_sqls :: Lens.Lens' BatchExecuteStatement (Prelude.NonEmpty Prelude.Text)+batchExecuteStatement_sqls = Lens.lens (\BatchExecuteStatement' {sqls} -> sqls) (\s@BatchExecuteStatement' {} a -> s {sqls = a} :: BatchExecuteStatement) Prelude.. Lens.coerced++instance Core.AWSRequest BatchExecuteStatement where+ type+ AWSResponse BatchExecuteStatement =+ BatchExecuteStatementResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ BatchExecuteStatementResponse'+ Prelude.<$> (x Data..?> "ClusterIdentifier")+ Prelude.<*> (x Data..?> "CreatedAt")+ Prelude.<*> (x Data..?> "Database")+ Prelude.<*> (x Data..?> "DbUser")+ Prelude.<*> (x Data..?> "Id")+ Prelude.<*> (x Data..?> "SecretArn")+ Prelude.<*> (x Data..?> "WorkgroupName")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable BatchExecuteStatement where+ hashWithSalt _salt BatchExecuteStatement' {..} =+ _salt+ `Prelude.hashWithSalt` clientToken+ `Prelude.hashWithSalt` clusterIdentifier+ `Prelude.hashWithSalt` dbUser+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` statementName+ `Prelude.hashWithSalt` withEvent+ `Prelude.hashWithSalt` workgroupName+ `Prelude.hashWithSalt` database+ `Prelude.hashWithSalt` sqls++instance Prelude.NFData BatchExecuteStatement where+ rnf BatchExecuteStatement' {..} =+ Prelude.rnf clientToken+ `Prelude.seq` Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf statementName+ `Prelude.seq` Prelude.rnf withEvent+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf database+ `Prelude.seq` Prelude.rnf sqls++instance Data.ToHeaders BatchExecuteStatement where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ( "RedshiftData.BatchExecuteStatement" ::+ Prelude.ByteString+ ),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON BatchExecuteStatement where+ toJSON BatchExecuteStatement' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ClientToken" Data..=) Prelude.<$> clientToken,+ ("ClusterIdentifier" Data..=)+ Prelude.<$> clusterIdentifier,+ ("DbUser" Data..=) Prelude.<$> dbUser,+ ("SecretArn" Data..=) Prelude.<$> secretArn,+ ("StatementName" Data..=) Prelude.<$> statementName,+ ("WithEvent" Data..=) Prelude.<$> withEvent,+ ("WorkgroupName" Data..=) Prelude.<$> workgroupName,+ Prelude.Just ("Database" Data..= database),+ Prelude.Just ("Sqls" Data..= sqls)+ ]+ )++instance Data.ToPath BatchExecuteStatement where+ toPath = Prelude.const "/"++instance Data.ToQuery BatchExecuteStatement where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newBatchExecuteStatementResponse' smart constructor.+data BatchExecuteStatementResponse = BatchExecuteStatementResponse'+ { -- | The cluster identifier. This element is not returned when connecting to+ -- a serverless workgroup.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | The date and time (UTC) the statement was created.+ createdAt :: Prelude.Maybe Data.POSIX,+ -- | The name of the database.+ database :: Prelude.Maybe Prelude.Text,+ -- | The database user name.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The identifier of the SQL statement whose results are to be fetched.+ -- This value is a universally unique identifier (UUID) generated by Amazon+ -- Redshift Data API. This identifier is returned by+ -- @BatchExecuteStatment@.+ id :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The serverless workgroup name. This element is not returned when+ -- connecting to a provisioned cluster.+ workgroupName :: 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 'BatchExecuteStatementResponse' 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:+--+-- 'clusterIdentifier', 'batchExecuteStatementResponse_clusterIdentifier' - The cluster identifier. This element is not returned when connecting to+-- a serverless workgroup.+--+-- 'createdAt', 'batchExecuteStatementResponse_createdAt' - The date and time (UTC) the statement was created.+--+-- 'database', 'batchExecuteStatementResponse_database' - The name of the database.+--+-- 'dbUser', 'batchExecuteStatementResponse_dbUser' - The database user name.+--+-- 'id', 'batchExecuteStatementResponse_id' - The identifier of the SQL statement whose results are to be fetched.+-- This value is a universally unique identifier (UUID) generated by Amazon+-- Redshift Data API. This identifier is returned by+-- @BatchExecuteStatment@.+--+-- 'secretArn', 'batchExecuteStatementResponse_secretArn' - The name or ARN of the secret that enables access to the database.+--+-- 'workgroupName', 'batchExecuteStatementResponse_workgroupName' - The serverless workgroup name. This element is not returned when+-- connecting to a provisioned cluster.+--+-- 'httpStatus', 'batchExecuteStatementResponse_httpStatus' - The response's http status code.+newBatchExecuteStatementResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ BatchExecuteStatementResponse+newBatchExecuteStatementResponse pHttpStatus_ =+ BatchExecuteStatementResponse'+ { clusterIdentifier =+ Prelude.Nothing,+ createdAt = Prelude.Nothing,+ database = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ id = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | The cluster identifier. This element is not returned when connecting to+-- a serverless workgroup.+batchExecuteStatementResponse_clusterIdentifier :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.Text)+batchExecuteStatementResponse_clusterIdentifier = Lens.lens (\BatchExecuteStatementResponse' {clusterIdentifier} -> clusterIdentifier) (\s@BatchExecuteStatementResponse' {} a -> s {clusterIdentifier = a} :: BatchExecuteStatementResponse)++-- | The date and time (UTC) the statement was created.+batchExecuteStatementResponse_createdAt :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.UTCTime)+batchExecuteStatementResponse_createdAt = Lens.lens (\BatchExecuteStatementResponse' {createdAt} -> createdAt) (\s@BatchExecuteStatementResponse' {} a -> s {createdAt = a} :: BatchExecuteStatementResponse) Prelude.. Lens.mapping Data._Time++-- | The name of the database.+batchExecuteStatementResponse_database :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.Text)+batchExecuteStatementResponse_database = Lens.lens (\BatchExecuteStatementResponse' {database} -> database) (\s@BatchExecuteStatementResponse' {} a -> s {database = a} :: BatchExecuteStatementResponse)++-- | The database user name.+batchExecuteStatementResponse_dbUser :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.Text)+batchExecuteStatementResponse_dbUser = Lens.lens (\BatchExecuteStatementResponse' {dbUser} -> dbUser) (\s@BatchExecuteStatementResponse' {} a -> s {dbUser = a} :: BatchExecuteStatementResponse)++-- | The identifier of the SQL statement whose results are to be fetched.+-- This value is a universally unique identifier (UUID) generated by Amazon+-- Redshift Data API. This identifier is returned by+-- @BatchExecuteStatment@.+batchExecuteStatementResponse_id :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.Text)+batchExecuteStatementResponse_id = Lens.lens (\BatchExecuteStatementResponse' {id} -> id) (\s@BatchExecuteStatementResponse' {} a -> s {id = a} :: BatchExecuteStatementResponse)++-- | The name or ARN of the secret that enables access to the database.+batchExecuteStatementResponse_secretArn :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.Text)+batchExecuteStatementResponse_secretArn = Lens.lens (\BatchExecuteStatementResponse' {secretArn} -> secretArn) (\s@BatchExecuteStatementResponse' {} a -> s {secretArn = a} :: BatchExecuteStatementResponse)++-- | The serverless workgroup name. This element is not returned when+-- connecting to a provisioned cluster.+batchExecuteStatementResponse_workgroupName :: Lens.Lens' BatchExecuteStatementResponse (Prelude.Maybe Prelude.Text)+batchExecuteStatementResponse_workgroupName = Lens.lens (\BatchExecuteStatementResponse' {workgroupName} -> workgroupName) (\s@BatchExecuteStatementResponse' {} a -> s {workgroupName = a} :: BatchExecuteStatementResponse)++-- | The response's http status code.+batchExecuteStatementResponse_httpStatus :: Lens.Lens' BatchExecuteStatementResponse Prelude.Int+batchExecuteStatementResponse_httpStatus = Lens.lens (\BatchExecuteStatementResponse' {httpStatus} -> httpStatus) (\s@BatchExecuteStatementResponse' {} a -> s {httpStatus = a} :: BatchExecuteStatementResponse)++instance Prelude.NFData BatchExecuteStatementResponse where+ rnf BatchExecuteStatementResponse' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf createdAt+ `Prelude.seq` Prelude.rnf database+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf id+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/CancelStatement.hs view
@@ -0,0 +1,178 @@+{-# 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.RedshiftData.CancelStatement+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Cancels a running query. To be canceled, a query must be running.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+module Amazonka.RedshiftData.CancelStatement+ ( -- * Creating a Request+ CancelStatement (..),+ newCancelStatement,++ -- * Request Lenses+ cancelStatement_id,++ -- * Destructuring the Response+ CancelStatementResponse (..),+ newCancelStatementResponse,++ -- * Response Lenses+ cancelStatementResponse_status,+ cancelStatementResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newCancelStatement' smart constructor.+data CancelStatement = CancelStatement'+ { -- | The identifier of the SQL statement to cancel. This value is a+ -- universally unique identifier (UUID) generated by Amazon Redshift Data+ -- API. This identifier is returned by @BatchExecuteStatment@,+ -- @ExecuteStatment@, and @ListStatements@.+ id :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CancelStatement' 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:+--+-- 'id', 'cancelStatement_id' - The identifier of the SQL statement to cancel. This value is a+-- universally unique identifier (UUID) generated by Amazon Redshift Data+-- API. This identifier is returned by @BatchExecuteStatment@,+-- @ExecuteStatment@, and @ListStatements@.+newCancelStatement ::+ -- | 'id'+ Prelude.Text ->+ CancelStatement+newCancelStatement pId_ = CancelStatement' {id = pId_}++-- | The identifier of the SQL statement to cancel. This value is a+-- universally unique identifier (UUID) generated by Amazon Redshift Data+-- API. This identifier is returned by @BatchExecuteStatment@,+-- @ExecuteStatment@, and @ListStatements@.+cancelStatement_id :: Lens.Lens' CancelStatement Prelude.Text+cancelStatement_id = Lens.lens (\CancelStatement' {id} -> id) (\s@CancelStatement' {} a -> s {id = a} :: CancelStatement)++instance Core.AWSRequest CancelStatement where+ type+ AWSResponse CancelStatement =+ CancelStatementResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ CancelStatementResponse'+ Prelude.<$> (x Data..?> "Status")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable CancelStatement where+ hashWithSalt _salt CancelStatement' {..} =+ _salt `Prelude.hashWithSalt` id++instance Prelude.NFData CancelStatement where+ rnf CancelStatement' {..} = Prelude.rnf id++instance Data.ToHeaders CancelStatement where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ( "RedshiftData.CancelStatement" ::+ Prelude.ByteString+ ),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON CancelStatement where+ toJSON CancelStatement' {..} =+ Data.object+ (Prelude.catMaybes [Prelude.Just ("Id" Data..= id)])++instance Data.ToPath CancelStatement where+ toPath = Prelude.const "/"++instance Data.ToQuery CancelStatement where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newCancelStatementResponse' smart constructor.+data CancelStatementResponse = CancelStatementResponse'+ { -- | A value that indicates whether the cancel statement succeeded (true).+ status :: Prelude.Maybe Prelude.Bool,+ -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'CancelStatementResponse' 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:+--+-- 'status', 'cancelStatementResponse_status' - A value that indicates whether the cancel statement succeeded (true).+--+-- 'httpStatus', 'cancelStatementResponse_httpStatus' - The response's http status code.+newCancelStatementResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ CancelStatementResponse+newCancelStatementResponse pHttpStatus_ =+ CancelStatementResponse'+ { status = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | A value that indicates whether the cancel statement succeeded (true).+cancelStatementResponse_status :: Lens.Lens' CancelStatementResponse (Prelude.Maybe Prelude.Bool)+cancelStatementResponse_status = Lens.lens (\CancelStatementResponse' {status} -> status) (\s@CancelStatementResponse' {} a -> s {status = a} :: CancelStatementResponse)++-- | The response's http status code.+cancelStatementResponse_httpStatus :: Lens.Lens' CancelStatementResponse Prelude.Int+cancelStatementResponse_httpStatus = Lens.lens (\CancelStatementResponse' {httpStatus} -> httpStatus) (\s@CancelStatementResponse' {} a -> s {httpStatus = a} :: CancelStatementResponse)++instance Prelude.NFData CancelStatementResponse where+ rnf CancelStatementResponse' {..} =+ Prelude.rnf status+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/DescribeStatement.hs view
@@ -0,0 +1,497 @@+{-# 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.RedshiftData.DescribeStatement+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Describes the details about a specific instance when a query was run by+-- the Amazon Redshift Data API. The information includes when the query+-- started, when it finished, the query status, the number of rows+-- returned, and the SQL statement.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+module Amazonka.RedshiftData.DescribeStatement+ ( -- * Creating a Request+ DescribeStatement (..),+ newDescribeStatement,++ -- * Request Lenses+ describeStatement_id,++ -- * Destructuring the Response+ DescribeStatementResponse (..),+ newDescribeStatementResponse,++ -- * Response Lenses+ describeStatementResponse_clusterIdentifier,+ describeStatementResponse_createdAt,+ describeStatementResponse_database,+ describeStatementResponse_dbUser,+ describeStatementResponse_duration,+ describeStatementResponse_error,+ describeStatementResponse_hasResultSet,+ describeStatementResponse_queryParameters,+ describeStatementResponse_queryString,+ describeStatementResponse_redshiftPid,+ describeStatementResponse_redshiftQueryId,+ describeStatementResponse_resultRows,+ describeStatementResponse_resultSize,+ describeStatementResponse_secretArn,+ describeStatementResponse_status,+ describeStatementResponse_subStatements,+ describeStatementResponse_updatedAt,+ describeStatementResponse_workgroupName,+ describeStatementResponse_httpStatus,+ describeStatementResponse_id,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newDescribeStatement' smart constructor.+data DescribeStatement = DescribeStatement'+ { -- | The identifier of the SQL statement to describe. This value is a+ -- universally unique identifier (UUID) generated by Amazon Redshift Data+ -- API. A suffix indicates the number of the SQL statement. For example,+ -- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that+ -- indicates the second SQL statement of a batch query. This identifier is+ -- returned by @BatchExecuteStatment@, @ExecuteStatement@, and+ -- @ListStatements@.+ id :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'DescribeStatement' 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:+--+-- 'id', 'describeStatement_id' - The identifier of the SQL statement to describe. This value is a+-- universally unique identifier (UUID) generated by Amazon Redshift Data+-- API. A suffix indicates the number of the SQL statement. For example,+-- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that+-- indicates the second SQL statement of a batch query. This identifier is+-- returned by @BatchExecuteStatment@, @ExecuteStatement@, and+-- @ListStatements@.+newDescribeStatement ::+ -- | 'id'+ Prelude.Text ->+ DescribeStatement+newDescribeStatement pId_ =+ DescribeStatement' {id = pId_}++-- | The identifier of the SQL statement to describe. This value is a+-- universally unique identifier (UUID) generated by Amazon Redshift Data+-- API. A suffix indicates the number of the SQL statement. For example,+-- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that+-- indicates the second SQL statement of a batch query. This identifier is+-- returned by @BatchExecuteStatment@, @ExecuteStatement@, and+-- @ListStatements@.+describeStatement_id :: Lens.Lens' DescribeStatement Prelude.Text+describeStatement_id = Lens.lens (\DescribeStatement' {id} -> id) (\s@DescribeStatement' {} a -> s {id = a} :: DescribeStatement)++instance Core.AWSRequest DescribeStatement where+ type+ AWSResponse DescribeStatement =+ DescribeStatementResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ DescribeStatementResponse'+ Prelude.<$> (x Data..?> "ClusterIdentifier")+ Prelude.<*> (x Data..?> "CreatedAt")+ Prelude.<*> (x Data..?> "Database")+ Prelude.<*> (x Data..?> "DbUser")+ Prelude.<*> (x Data..?> "Duration")+ Prelude.<*> (x Data..?> "Error")+ Prelude.<*> (x Data..?> "HasResultSet")+ Prelude.<*> (x Data..?> "QueryParameters")+ Prelude.<*> (x Data..?> "QueryString")+ Prelude.<*> (x Data..?> "RedshiftPid")+ Prelude.<*> (x Data..?> "RedshiftQueryId")+ Prelude.<*> (x Data..?> "ResultRows")+ Prelude.<*> (x Data..?> "ResultSize")+ Prelude.<*> (x Data..?> "SecretArn")+ Prelude.<*> (x Data..?> "Status")+ Prelude.<*> (x Data..?> "SubStatements" Core..!@ Prelude.mempty)+ Prelude.<*> (x Data..?> "UpdatedAt")+ Prelude.<*> (x Data..?> "WorkgroupName")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ Prelude.<*> (x Data..:> "Id")+ )++instance Prelude.Hashable DescribeStatement where+ hashWithSalt _salt DescribeStatement' {..} =+ _salt `Prelude.hashWithSalt` id++instance Prelude.NFData DescribeStatement where+ rnf DescribeStatement' {..} = Prelude.rnf id++instance Data.ToHeaders DescribeStatement where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ( "RedshiftData.DescribeStatement" ::+ Prelude.ByteString+ ),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON DescribeStatement where+ toJSON DescribeStatement' {..} =+ Data.object+ (Prelude.catMaybes [Prelude.Just ("Id" Data..= id)])++instance Data.ToPath DescribeStatement where+ toPath = Prelude.const "/"++instance Data.ToQuery DescribeStatement where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newDescribeStatementResponse' smart constructor.+data DescribeStatementResponse = DescribeStatementResponse'+ { -- | The cluster identifier.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | The date and time (UTC) when the SQL statement was submitted to run.+ createdAt :: Prelude.Maybe Data.POSIX,+ -- | The name of the database.+ database :: Prelude.Maybe Prelude.Text,+ -- | The database user name.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The amount of time in nanoseconds that the statement ran.+ duration :: Prelude.Maybe Prelude.Integer,+ -- | The error message from the cluster if the SQL statement encountered an+ -- error while running.+ error :: Prelude.Maybe Prelude.Text,+ -- | A value that indicates whether the statement has a result set. The+ -- result set can be empty. The value is true for an empty result set. The+ -- value is true if any substatement returns a result set.+ hasResultSet :: Prelude.Maybe Prelude.Bool,+ -- | The parameters for the SQL statement.+ queryParameters :: Prelude.Maybe (Prelude.NonEmpty SqlParameter),+ -- | The SQL statement text.+ queryString :: Prelude.Maybe Prelude.Text,+ -- | The process identifier from Amazon Redshift.+ redshiftPid :: Prelude.Maybe Prelude.Integer,+ -- | The identifier of the query generated by Amazon Redshift. These+ -- identifiers are also available in the @query@ column of the @STL_QUERY@+ -- system view.+ redshiftQueryId :: Prelude.Maybe Prelude.Integer,+ -- | Either the number of rows returned from the SQL statement or the number+ -- of rows affected. If result size is greater than zero, the result rows+ -- can be the number of rows affected by SQL statements such as INSERT,+ -- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.+ resultRows :: Prelude.Maybe Prelude.Integer,+ -- | The size in bytes of the returned results. A @-1@ indicates the value is+ -- null.+ resultSize :: Prelude.Maybe Prelude.Integer,+ -- | The name or Amazon Resource Name (ARN) of the secret that enables access+ -- to the database.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The status of the SQL statement being described. Status values are+ -- defined as follows:+ --+ -- - ABORTED - The query run was stopped by the user.+ --+ -- - ALL - A status value that includes all query statuses. This value+ -- can be used to filter results.+ --+ -- - FAILED - The query run failed.+ --+ -- - FINISHED - The query has finished running.+ --+ -- - PICKED - The query has been chosen to be run.+ --+ -- - STARTED - The query run has started.+ --+ -- - SUBMITTED - The query was submitted, but not yet processed.+ status :: Prelude.Maybe StatusString,+ -- | The SQL statements from a multiple statement run.+ subStatements :: Prelude.Maybe [SubStatementData],+ -- | The date and time (UTC) that the metadata for the SQL statement was last+ -- updated. An example is the time the status last changed.+ updatedAt :: Prelude.Maybe Data.POSIX,+ -- | The serverless workgroup name.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The response's http status code.+ httpStatus :: Prelude.Int,+ -- | The identifier of the SQL statement described. This value is a+ -- universally unique identifier (UUID) generated by Amazon Redshift Data+ -- API.+ id :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'DescribeStatementResponse' 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:+--+-- 'clusterIdentifier', 'describeStatementResponse_clusterIdentifier' - The cluster identifier.+--+-- 'createdAt', 'describeStatementResponse_createdAt' - The date and time (UTC) when the SQL statement was submitted to run.+--+-- 'database', 'describeStatementResponse_database' - The name of the database.+--+-- 'dbUser', 'describeStatementResponse_dbUser' - The database user name.+--+-- 'duration', 'describeStatementResponse_duration' - The amount of time in nanoseconds that the statement ran.+--+-- 'error', 'describeStatementResponse_error' - The error message from the cluster if the SQL statement encountered an+-- error while running.+--+-- 'hasResultSet', 'describeStatementResponse_hasResultSet' - A value that indicates whether the statement has a result set. The+-- result set can be empty. The value is true for an empty result set. The+-- value is true if any substatement returns a result set.+--+-- 'queryParameters', 'describeStatementResponse_queryParameters' - The parameters for the SQL statement.+--+-- 'queryString', 'describeStatementResponse_queryString' - The SQL statement text.+--+-- 'redshiftPid', 'describeStatementResponse_redshiftPid' - The process identifier from Amazon Redshift.+--+-- 'redshiftQueryId', 'describeStatementResponse_redshiftQueryId' - The identifier of the query generated by Amazon Redshift. These+-- identifiers are also available in the @query@ column of the @STL_QUERY@+-- system view.+--+-- 'resultRows', 'describeStatementResponse_resultRows' - Either the number of rows returned from the SQL statement or the number+-- of rows affected. If result size is greater than zero, the result rows+-- can be the number of rows affected by SQL statements such as INSERT,+-- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.+--+-- 'resultSize', 'describeStatementResponse_resultSize' - The size in bytes of the returned results. A @-1@ indicates the value is+-- null.+--+-- 'secretArn', 'describeStatementResponse_secretArn' - The name or Amazon Resource Name (ARN) of the secret that enables access+-- to the database.+--+-- 'status', 'describeStatementResponse_status' - The status of the SQL statement being described. Status values are+-- defined as follows:+--+-- - ABORTED - The query run was stopped by the user.+--+-- - ALL - A status value that includes all query statuses. This value+-- can be used to filter results.+--+-- - FAILED - The query run failed.+--+-- - FINISHED - The query has finished running.+--+-- - PICKED - The query has been chosen to be run.+--+-- - STARTED - The query run has started.+--+-- - SUBMITTED - The query was submitted, but not yet processed.+--+-- 'subStatements', 'describeStatementResponse_subStatements' - The SQL statements from a multiple statement run.+--+-- 'updatedAt', 'describeStatementResponse_updatedAt' - The date and time (UTC) that the metadata for the SQL statement was last+-- updated. An example is the time the status last changed.+--+-- 'workgroupName', 'describeStatementResponse_workgroupName' - The serverless workgroup name.+--+-- 'httpStatus', 'describeStatementResponse_httpStatus' - The response's http status code.+--+-- 'id', 'describeStatementResponse_id' - The identifier of the SQL statement described. This value is a+-- universally unique identifier (UUID) generated by Amazon Redshift Data+-- API.+newDescribeStatementResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ -- | 'id'+ Prelude.Text ->+ DescribeStatementResponse+newDescribeStatementResponse pHttpStatus_ pId_ =+ DescribeStatementResponse'+ { clusterIdentifier =+ Prelude.Nothing,+ createdAt = Prelude.Nothing,+ database = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ duration = Prelude.Nothing,+ error = Prelude.Nothing,+ hasResultSet = Prelude.Nothing,+ queryParameters = Prelude.Nothing,+ queryString = Prelude.Nothing,+ redshiftPid = Prelude.Nothing,+ redshiftQueryId = Prelude.Nothing,+ resultRows = Prelude.Nothing,+ resultSize = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ status = Prelude.Nothing,+ subStatements = Prelude.Nothing,+ updatedAt = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ httpStatus = pHttpStatus_,+ id = pId_+ }++-- | The cluster identifier.+describeStatementResponse_clusterIdentifier :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_clusterIdentifier = Lens.lens (\DescribeStatementResponse' {clusterIdentifier} -> clusterIdentifier) (\s@DescribeStatementResponse' {} a -> s {clusterIdentifier = a} :: DescribeStatementResponse)++-- | The date and time (UTC) when the SQL statement was submitted to run.+describeStatementResponse_createdAt :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.UTCTime)+describeStatementResponse_createdAt = Lens.lens (\DescribeStatementResponse' {createdAt} -> createdAt) (\s@DescribeStatementResponse' {} a -> s {createdAt = a} :: DescribeStatementResponse) Prelude.. Lens.mapping Data._Time++-- | The name of the database.+describeStatementResponse_database :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_database = Lens.lens (\DescribeStatementResponse' {database} -> database) (\s@DescribeStatementResponse' {} a -> s {database = a} :: DescribeStatementResponse)++-- | The database user name.+describeStatementResponse_dbUser :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_dbUser = Lens.lens (\DescribeStatementResponse' {dbUser} -> dbUser) (\s@DescribeStatementResponse' {} a -> s {dbUser = a} :: DescribeStatementResponse)++-- | The amount of time in nanoseconds that the statement ran.+describeStatementResponse_duration :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Integer)+describeStatementResponse_duration = Lens.lens (\DescribeStatementResponse' {duration} -> duration) (\s@DescribeStatementResponse' {} a -> s {duration = a} :: DescribeStatementResponse)++-- | The error message from the cluster if the SQL statement encountered an+-- error while running.+describeStatementResponse_error :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_error = Lens.lens (\DescribeStatementResponse' {error} -> error) (\s@DescribeStatementResponse' {} a -> s {error = a} :: DescribeStatementResponse)++-- | A value that indicates whether the statement has a result set. The+-- result set can be empty. The value is true for an empty result set. The+-- value is true if any substatement returns a result set.+describeStatementResponse_hasResultSet :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Bool)+describeStatementResponse_hasResultSet = Lens.lens (\DescribeStatementResponse' {hasResultSet} -> hasResultSet) (\s@DescribeStatementResponse' {} a -> s {hasResultSet = a} :: DescribeStatementResponse)++-- | The parameters for the SQL statement.+describeStatementResponse_queryParameters :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe (Prelude.NonEmpty SqlParameter))+describeStatementResponse_queryParameters = Lens.lens (\DescribeStatementResponse' {queryParameters} -> queryParameters) (\s@DescribeStatementResponse' {} a -> s {queryParameters = a} :: DescribeStatementResponse) Prelude.. Lens.mapping Lens.coerced++-- | The SQL statement text.+describeStatementResponse_queryString :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_queryString = Lens.lens (\DescribeStatementResponse' {queryString} -> queryString) (\s@DescribeStatementResponse' {} a -> s {queryString = a} :: DescribeStatementResponse)++-- | The process identifier from Amazon Redshift.+describeStatementResponse_redshiftPid :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Integer)+describeStatementResponse_redshiftPid = Lens.lens (\DescribeStatementResponse' {redshiftPid} -> redshiftPid) (\s@DescribeStatementResponse' {} a -> s {redshiftPid = a} :: DescribeStatementResponse)++-- | The identifier of the query generated by Amazon Redshift. These+-- identifiers are also available in the @query@ column of the @STL_QUERY@+-- system view.+describeStatementResponse_redshiftQueryId :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Integer)+describeStatementResponse_redshiftQueryId = Lens.lens (\DescribeStatementResponse' {redshiftQueryId} -> redshiftQueryId) (\s@DescribeStatementResponse' {} a -> s {redshiftQueryId = a} :: DescribeStatementResponse)++-- | Either the number of rows returned from the SQL statement or the number+-- of rows affected. If result size is greater than zero, the result rows+-- can be the number of rows affected by SQL statements such as INSERT,+-- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.+describeStatementResponse_resultRows :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Integer)+describeStatementResponse_resultRows = Lens.lens (\DescribeStatementResponse' {resultRows} -> resultRows) (\s@DescribeStatementResponse' {} a -> s {resultRows = a} :: DescribeStatementResponse)++-- | The size in bytes of the returned results. A @-1@ indicates the value is+-- null.+describeStatementResponse_resultSize :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Integer)+describeStatementResponse_resultSize = Lens.lens (\DescribeStatementResponse' {resultSize} -> resultSize) (\s@DescribeStatementResponse' {} a -> s {resultSize = a} :: DescribeStatementResponse)++-- | The name or Amazon Resource Name (ARN) of the secret that enables access+-- to the database.+describeStatementResponse_secretArn :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_secretArn = Lens.lens (\DescribeStatementResponse' {secretArn} -> secretArn) (\s@DescribeStatementResponse' {} a -> s {secretArn = a} :: DescribeStatementResponse)++-- | The status of the SQL statement being described. Status values are+-- defined as follows:+--+-- - ABORTED - The query run was stopped by the user.+--+-- - ALL - A status value that includes all query statuses. This value+-- can be used to filter results.+--+-- - FAILED - The query run failed.+--+-- - FINISHED - The query has finished running.+--+-- - PICKED - The query has been chosen to be run.+--+-- - STARTED - The query run has started.+--+-- - SUBMITTED - The query was submitted, but not yet processed.+describeStatementResponse_status :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe StatusString)+describeStatementResponse_status = Lens.lens (\DescribeStatementResponse' {status} -> status) (\s@DescribeStatementResponse' {} a -> s {status = a} :: DescribeStatementResponse)++-- | The SQL statements from a multiple statement run.+describeStatementResponse_subStatements :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe [SubStatementData])+describeStatementResponse_subStatements = Lens.lens (\DescribeStatementResponse' {subStatements} -> subStatements) (\s@DescribeStatementResponse' {} a -> s {subStatements = a} :: DescribeStatementResponse) Prelude.. Lens.mapping Lens.coerced++-- | The date and time (UTC) that the metadata for the SQL statement was last+-- updated. An example is the time the status last changed.+describeStatementResponse_updatedAt :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.UTCTime)+describeStatementResponse_updatedAt = Lens.lens (\DescribeStatementResponse' {updatedAt} -> updatedAt) (\s@DescribeStatementResponse' {} a -> s {updatedAt = a} :: DescribeStatementResponse) Prelude.. Lens.mapping Data._Time++-- | The serverless workgroup name.+describeStatementResponse_workgroupName :: Lens.Lens' DescribeStatementResponse (Prelude.Maybe Prelude.Text)+describeStatementResponse_workgroupName = Lens.lens (\DescribeStatementResponse' {workgroupName} -> workgroupName) (\s@DescribeStatementResponse' {} a -> s {workgroupName = a} :: DescribeStatementResponse)++-- | The response's http status code.+describeStatementResponse_httpStatus :: Lens.Lens' DescribeStatementResponse Prelude.Int+describeStatementResponse_httpStatus = Lens.lens (\DescribeStatementResponse' {httpStatus} -> httpStatus) (\s@DescribeStatementResponse' {} a -> s {httpStatus = a} :: DescribeStatementResponse)++-- | The identifier of the SQL statement described. This value is a+-- universally unique identifier (UUID) generated by Amazon Redshift Data+-- API.+describeStatementResponse_id :: Lens.Lens' DescribeStatementResponse Prelude.Text+describeStatementResponse_id = Lens.lens (\DescribeStatementResponse' {id} -> id) (\s@DescribeStatementResponse' {} a -> s {id = a} :: DescribeStatementResponse)++instance Prelude.NFData DescribeStatementResponse where+ rnf DescribeStatementResponse' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf createdAt+ `Prelude.seq` Prelude.rnf database+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf duration+ `Prelude.seq` Prelude.rnf error+ `Prelude.seq` Prelude.rnf hasResultSet+ `Prelude.seq` Prelude.rnf queryParameters+ `Prelude.seq` Prelude.rnf queryString+ `Prelude.seq` Prelude.rnf redshiftPid+ `Prelude.seq` Prelude.rnf redshiftQueryId+ `Prelude.seq` Prelude.rnf resultRows+ `Prelude.seq` Prelude.rnf resultSize+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf status+ `Prelude.seq` Prelude.rnf subStatements+ `Prelude.seq` Prelude.rnf updatedAt+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf httpStatus+ `Prelude.seq` Prelude.rnf id
+ gen/Amazonka/RedshiftData/DescribeTable.hs view
@@ -0,0 +1,431 @@+{-# 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.RedshiftData.DescribeTable+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Describes the detailed information about a table from metadata in the+-- cluster. The information includes its columns. A token is returned to+-- page through the column list. Depending on the authorization method, use+-- one of the following combinations of request parameters:+--+-- - Secrets Manager - when connecting to a cluster, specify the Amazon+-- Resource Name (ARN) of the secret, the database name, and the+-- cluster identifier that matches the cluster in the secret. When+-- connecting to a serverless workgroup, specify the Amazon Resource+-- Name (ARN) of the secret and the database name.+--+-- - Temporary credentials - when connecting to a cluster, specify the+-- cluster identifier, the database name, and the database user name.+-- Also, permission to call the @redshift:GetClusterCredentials@+-- operation is required. When connecting to a serverless workgroup,+-- specify the workgroup name and database name. Also, permission to+-- call the @redshift-serverless:GetCredentials@ operation is required.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+--+-- This operation returns paginated results.+module Amazonka.RedshiftData.DescribeTable+ ( -- * Creating a Request+ DescribeTable (..),+ newDescribeTable,++ -- * Request Lenses+ describeTable_clusterIdentifier,+ describeTable_connectedDatabase,+ describeTable_dbUser,+ describeTable_maxResults,+ describeTable_nextToken,+ describeTable_schema,+ describeTable_secretArn,+ describeTable_table,+ describeTable_workgroupName,+ describeTable_database,++ -- * Destructuring the Response+ DescribeTableResponse (..),+ newDescribeTableResponse,++ -- * Response Lenses+ describeTableResponse_columnList,+ describeTableResponse_nextToken,+ describeTableResponse_tableName,+ describeTableResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newDescribeTable' smart constructor.+data DescribeTable = DescribeTable'+ { -- | The cluster identifier. This parameter is required when connecting to a+ -- cluster and authenticating using either Secrets Manager or temporary+ -- credentials.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | A database name. The connected database is specified when you connect+ -- with your authentication credentials.+ connectedDatabase :: Prelude.Maybe Prelude.Text,+ -- | The database user name. This parameter is required when connecting to a+ -- cluster and authenticating using temporary credentials.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The maximum number of tables to return in the response. If more tables+ -- exist than fit in one response, then @NextToken@ is returned to page+ -- through the results.+ maxResults :: Prelude.Maybe Prelude.Natural,+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The schema that contains the table. If no schema is specified, then+ -- matching tables for all schemas are returned.+ schema :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database. This+ -- parameter is required when authenticating using Secrets Manager.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The table name. If no table is specified, then all tables for all+ -- matching schemas are returned. If no table and no schema is specified,+ -- then all tables for all schemas in the database are returned+ table :: Prelude.Maybe Prelude.Text,+ -- | The serverless workgroup name. This parameter is required when+ -- connecting to a serverless workgroup and authenticating using either+ -- Secrets Manager or temporary credentials.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The name of the database that contains the tables to be described. If+ -- @ConnectedDatabase@ is not specified, this is also the database to+ -- connect to with your authentication credentials.+ database :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'DescribeTable' 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:+--+-- 'clusterIdentifier', 'describeTable_clusterIdentifier' - The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+--+-- 'connectedDatabase', 'describeTable_connectedDatabase' - A database name. The connected database is specified when you connect+-- with your authentication credentials.+--+-- 'dbUser', 'describeTable_dbUser' - The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+--+-- 'maxResults', 'describeTable_maxResults' - The maximum number of tables to return in the response. If more tables+-- exist than fit in one response, then @NextToken@ is returned to page+-- through the results.+--+-- 'nextToken', 'describeTable_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'schema', 'describeTable_schema' - The schema that contains the table. If no schema is specified, then+-- matching tables for all schemas are returned.+--+-- 'secretArn', 'describeTable_secretArn' - The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+--+-- 'table', 'describeTable_table' - The table name. If no table is specified, then all tables for all+-- matching schemas are returned. If no table and no schema is specified,+-- then all tables for all schemas in the database are returned+--+-- 'workgroupName', 'describeTable_workgroupName' - The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+--+-- 'database', 'describeTable_database' - The name of the database that contains the tables to be described. If+-- @ConnectedDatabase@ is not specified, this is also the database to+-- connect to with your authentication credentials.+newDescribeTable ::+ -- | 'database'+ Prelude.Text ->+ DescribeTable+newDescribeTable pDatabase_ =+ DescribeTable'+ { clusterIdentifier = Prelude.Nothing,+ connectedDatabase = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ maxResults = Prelude.Nothing,+ nextToken = Prelude.Nothing,+ schema = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ table = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ database = pDatabase_+ }++-- | The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+describeTable_clusterIdentifier :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_clusterIdentifier = Lens.lens (\DescribeTable' {clusterIdentifier} -> clusterIdentifier) (\s@DescribeTable' {} a -> s {clusterIdentifier = a} :: DescribeTable)++-- | A database name. The connected database is specified when you connect+-- with your authentication credentials.+describeTable_connectedDatabase :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_connectedDatabase = Lens.lens (\DescribeTable' {connectedDatabase} -> connectedDatabase) (\s@DescribeTable' {} a -> s {connectedDatabase = a} :: DescribeTable)++-- | The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+describeTable_dbUser :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_dbUser = Lens.lens (\DescribeTable' {dbUser} -> dbUser) (\s@DescribeTable' {} a -> s {dbUser = a} :: DescribeTable)++-- | The maximum number of tables to return in the response. If more tables+-- exist than fit in one response, then @NextToken@ is returned to page+-- through the results.+describeTable_maxResults :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Natural)+describeTable_maxResults = Lens.lens (\DescribeTable' {maxResults} -> maxResults) (\s@DescribeTable' {} a -> s {maxResults = a} :: DescribeTable)++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+describeTable_nextToken :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_nextToken = Lens.lens (\DescribeTable' {nextToken} -> nextToken) (\s@DescribeTable' {} a -> s {nextToken = a} :: DescribeTable)++-- | The schema that contains the table. If no schema is specified, then+-- matching tables for all schemas are returned.+describeTable_schema :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_schema = Lens.lens (\DescribeTable' {schema} -> schema) (\s@DescribeTable' {} a -> s {schema = a} :: DescribeTable)++-- | The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+describeTable_secretArn :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_secretArn = Lens.lens (\DescribeTable' {secretArn} -> secretArn) (\s@DescribeTable' {} a -> s {secretArn = a} :: DescribeTable)++-- | The table name. If no table is specified, then all tables for all+-- matching schemas are returned. If no table and no schema is specified,+-- then all tables for all schemas in the database are returned+describeTable_table :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_table = Lens.lens (\DescribeTable' {table} -> table) (\s@DescribeTable' {} a -> s {table = a} :: DescribeTable)++-- | The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+describeTable_workgroupName :: Lens.Lens' DescribeTable (Prelude.Maybe Prelude.Text)+describeTable_workgroupName = Lens.lens (\DescribeTable' {workgroupName} -> workgroupName) (\s@DescribeTable' {} a -> s {workgroupName = a} :: DescribeTable)++-- | The name of the database that contains the tables to be described. If+-- @ConnectedDatabase@ is not specified, this is also the database to+-- connect to with your authentication credentials.+describeTable_database :: Lens.Lens' DescribeTable Prelude.Text+describeTable_database = Lens.lens (\DescribeTable' {database} -> database) (\s@DescribeTable' {} a -> s {database = a} :: DescribeTable)++instance Core.AWSPager DescribeTable where+ page rq rs+ | Core.stop+ ( rs+ Lens.^? describeTableResponse_nextToken+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Core.stop+ ( rs+ Lens.^? describeTableResponse_columnList+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Prelude.otherwise =+ Prelude.Just+ Prelude.$ rq+ Prelude.& describeTable_nextToken+ Lens..~ rs+ Lens.^? describeTableResponse_nextToken+ Prelude.. Lens._Just++instance Core.AWSRequest DescribeTable where+ type+ AWSResponse DescribeTable =+ DescribeTableResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ DescribeTableResponse'+ Prelude.<$> (x Data..?> "ColumnList" Core..!@ Prelude.mempty)+ Prelude.<*> (x Data..?> "NextToken")+ Prelude.<*> (x Data..?> "TableName")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable DescribeTable where+ hashWithSalt _salt DescribeTable' {..} =+ _salt+ `Prelude.hashWithSalt` clusterIdentifier+ `Prelude.hashWithSalt` connectedDatabase+ `Prelude.hashWithSalt` dbUser+ `Prelude.hashWithSalt` maxResults+ `Prelude.hashWithSalt` nextToken+ `Prelude.hashWithSalt` schema+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` table+ `Prelude.hashWithSalt` workgroupName+ `Prelude.hashWithSalt` database++instance Prelude.NFData DescribeTable where+ rnf DescribeTable' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf connectedDatabase+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf maxResults+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf schema+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf table+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf database++instance Data.ToHeaders DescribeTable where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ("RedshiftData.DescribeTable" :: Prelude.ByteString),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON DescribeTable where+ toJSON DescribeTable' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ClusterIdentifier" Data..=)+ Prelude.<$> clusterIdentifier,+ ("ConnectedDatabase" Data..=)+ Prelude.<$> connectedDatabase,+ ("DbUser" Data..=) Prelude.<$> dbUser,+ ("MaxResults" Data..=) Prelude.<$> maxResults,+ ("NextToken" Data..=) Prelude.<$> nextToken,+ ("Schema" Data..=) Prelude.<$> schema,+ ("SecretArn" Data..=) Prelude.<$> secretArn,+ ("Table" Data..=) Prelude.<$> table,+ ("WorkgroupName" Data..=) Prelude.<$> workgroupName,+ Prelude.Just ("Database" Data..= database)+ ]+ )++instance Data.ToPath DescribeTable where+ toPath = Prelude.const "/"++instance Data.ToQuery DescribeTable where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newDescribeTableResponse' smart constructor.+data DescribeTableResponse = DescribeTableResponse'+ { -- | A list of columns in the table.+ columnList :: Prelude.Maybe [ColumnMetadata],+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The table name.+ tableName :: 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 'DescribeTableResponse' 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:+--+-- 'columnList', 'describeTableResponse_columnList' - A list of columns in the table.+--+-- 'nextToken', 'describeTableResponse_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'tableName', 'describeTableResponse_tableName' - The table name.+--+-- 'httpStatus', 'describeTableResponse_httpStatus' - The response's http status code.+newDescribeTableResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ DescribeTableResponse+newDescribeTableResponse pHttpStatus_ =+ DescribeTableResponse'+ { columnList =+ Prelude.Nothing,+ nextToken = Prelude.Nothing,+ tableName = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | A list of columns in the table.+describeTableResponse_columnList :: Lens.Lens' DescribeTableResponse (Prelude.Maybe [ColumnMetadata])+describeTableResponse_columnList = Lens.lens (\DescribeTableResponse' {columnList} -> columnList) (\s@DescribeTableResponse' {} a -> s {columnList = a} :: DescribeTableResponse) Prelude.. Lens.mapping Lens.coerced++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+describeTableResponse_nextToken :: Lens.Lens' DescribeTableResponse (Prelude.Maybe Prelude.Text)+describeTableResponse_nextToken = Lens.lens (\DescribeTableResponse' {nextToken} -> nextToken) (\s@DescribeTableResponse' {} a -> s {nextToken = a} :: DescribeTableResponse)++-- | The table name.+describeTableResponse_tableName :: Lens.Lens' DescribeTableResponse (Prelude.Maybe Prelude.Text)+describeTableResponse_tableName = Lens.lens (\DescribeTableResponse' {tableName} -> tableName) (\s@DescribeTableResponse' {} a -> s {tableName = a} :: DescribeTableResponse)++-- | The response's http status code.+describeTableResponse_httpStatus :: Lens.Lens' DescribeTableResponse Prelude.Int+describeTableResponse_httpStatus = Lens.lens (\DescribeTableResponse' {httpStatus} -> httpStatus) (\s@DescribeTableResponse' {} a -> s {httpStatus = a} :: DescribeTableResponse)++instance Prelude.NFData DescribeTableResponse where+ rnf DescribeTableResponse' {..} =+ Prelude.rnf columnList+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf tableName+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/ExecuteStatement.hs view
@@ -0,0 +1,428 @@+{-# 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.RedshiftData.ExecuteStatement+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Runs an SQL statement, which can be data manipulation language (DML) or+-- data definition language (DDL). This statement must be a single SQL+-- statement. Depending on the authorization method, use one of the+-- following combinations of request parameters:+--+-- - Secrets Manager - when connecting to a cluster, specify the Amazon+-- Resource Name (ARN) of the secret, the database name, and the+-- cluster identifier that matches the cluster in the secret. When+-- connecting to a serverless workgroup, specify the Amazon Resource+-- Name (ARN) of the secret and the database name.+--+-- - Temporary credentials - when connecting to a cluster, specify the+-- cluster identifier, the database name, and the database user name.+-- Also, permission to call the @redshift:GetClusterCredentials@+-- operation is required. When connecting to a serverless workgroup,+-- specify the workgroup name and database name. Also, permission to+-- call the @redshift-serverless:GetCredentials@ operation is required.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+module Amazonka.RedshiftData.ExecuteStatement+ ( -- * Creating a Request+ ExecuteStatement (..),+ newExecuteStatement,++ -- * Request Lenses+ executeStatement_clientToken,+ executeStatement_clusterIdentifier,+ executeStatement_dbUser,+ executeStatement_parameters,+ executeStatement_secretArn,+ executeStatement_statementName,+ executeStatement_withEvent,+ executeStatement_workgroupName,+ executeStatement_database,+ executeStatement_sql,++ -- * Destructuring the Response+ ExecuteStatementResponse (..),+ newExecuteStatementResponse,++ -- * Response Lenses+ executeStatementResponse_clusterIdentifier,+ executeStatementResponse_createdAt,+ executeStatementResponse_database,+ executeStatementResponse_dbUser,+ executeStatementResponse_id,+ executeStatementResponse_secretArn,+ executeStatementResponse_workgroupName,+ executeStatementResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newExecuteStatement' smart constructor.+data ExecuteStatement = ExecuteStatement'+ { -- | A unique, case-sensitive identifier that you provide to ensure the+ -- idempotency of the request.+ clientToken :: Prelude.Maybe Prelude.Text,+ -- | The cluster identifier. This parameter is required when connecting to a+ -- cluster and authenticating using either Secrets Manager or temporary+ -- credentials.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | The database user name. This parameter is required when connecting to a+ -- cluster and authenticating using temporary credentials.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The parameters for the SQL statement.+ parameters :: Prelude.Maybe (Prelude.NonEmpty SqlParameter),+ -- | The name or ARN of the secret that enables access to the database. This+ -- parameter is required when authenticating using Secrets Manager.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The name of the SQL statement. You can name the SQL statement when you+ -- create it to identify the query.+ statementName :: Prelude.Maybe Prelude.Text,+ -- | A value that indicates whether to send an event to the Amazon+ -- EventBridge event bus after the SQL statement runs.+ withEvent :: Prelude.Maybe Prelude.Bool,+ -- | The serverless workgroup name. This parameter is required when+ -- connecting to a serverless workgroup and authenticating using either+ -- Secrets Manager or temporary credentials.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The name of the database. This parameter is required when authenticating+ -- using either Secrets Manager or temporary credentials.+ database :: Prelude.Text,+ -- | The SQL statement text to run.+ sql :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ExecuteStatement' 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:+--+-- 'clientToken', 'executeStatement_clientToken' - A unique, case-sensitive identifier that you provide to ensure the+-- idempotency of the request.+--+-- 'clusterIdentifier', 'executeStatement_clusterIdentifier' - The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+--+-- 'dbUser', 'executeStatement_dbUser' - The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+--+-- 'parameters', 'executeStatement_parameters' - The parameters for the SQL statement.+--+-- 'secretArn', 'executeStatement_secretArn' - The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+--+-- 'statementName', 'executeStatement_statementName' - The name of the SQL statement. You can name the SQL statement when you+-- create it to identify the query.+--+-- 'withEvent', 'executeStatement_withEvent' - A value that indicates whether to send an event to the Amazon+-- EventBridge event bus after the SQL statement runs.+--+-- 'workgroupName', 'executeStatement_workgroupName' - The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+--+-- 'database', 'executeStatement_database' - The name of the database. This parameter is required when authenticating+-- using either Secrets Manager or temporary credentials.+--+-- 'sql', 'executeStatement_sql' - The SQL statement text to run.+newExecuteStatement ::+ -- | 'database'+ Prelude.Text ->+ -- | 'sql'+ Prelude.Text ->+ ExecuteStatement+newExecuteStatement pDatabase_ pSql_ =+ ExecuteStatement'+ { clientToken = Prelude.Nothing,+ clusterIdentifier = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ parameters = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ statementName = Prelude.Nothing,+ withEvent = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ database = pDatabase_,+ sql = pSql_+ }++-- | A unique, case-sensitive identifier that you provide to ensure the+-- idempotency of the request.+executeStatement_clientToken :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Text)+executeStatement_clientToken = Lens.lens (\ExecuteStatement' {clientToken} -> clientToken) (\s@ExecuteStatement' {} a -> s {clientToken = a} :: ExecuteStatement)++-- | The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+executeStatement_clusterIdentifier :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Text)+executeStatement_clusterIdentifier = Lens.lens (\ExecuteStatement' {clusterIdentifier} -> clusterIdentifier) (\s@ExecuteStatement' {} a -> s {clusterIdentifier = a} :: ExecuteStatement)++-- | The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+executeStatement_dbUser :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Text)+executeStatement_dbUser = Lens.lens (\ExecuteStatement' {dbUser} -> dbUser) (\s@ExecuteStatement' {} a -> s {dbUser = a} :: ExecuteStatement)++-- | The parameters for the SQL statement.+executeStatement_parameters :: Lens.Lens' ExecuteStatement (Prelude.Maybe (Prelude.NonEmpty SqlParameter))+executeStatement_parameters = Lens.lens (\ExecuteStatement' {parameters} -> parameters) (\s@ExecuteStatement' {} a -> s {parameters = a} :: ExecuteStatement) Prelude.. Lens.mapping Lens.coerced++-- | The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+executeStatement_secretArn :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Text)+executeStatement_secretArn = Lens.lens (\ExecuteStatement' {secretArn} -> secretArn) (\s@ExecuteStatement' {} a -> s {secretArn = a} :: ExecuteStatement)++-- | The name of the SQL statement. You can name the SQL statement when you+-- create it to identify the query.+executeStatement_statementName :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Text)+executeStatement_statementName = Lens.lens (\ExecuteStatement' {statementName} -> statementName) (\s@ExecuteStatement' {} a -> s {statementName = a} :: ExecuteStatement)++-- | A value that indicates whether to send an event to the Amazon+-- EventBridge event bus after the SQL statement runs.+executeStatement_withEvent :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Bool)+executeStatement_withEvent = Lens.lens (\ExecuteStatement' {withEvent} -> withEvent) (\s@ExecuteStatement' {} a -> s {withEvent = a} :: ExecuteStatement)++-- | The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+executeStatement_workgroupName :: Lens.Lens' ExecuteStatement (Prelude.Maybe Prelude.Text)+executeStatement_workgroupName = Lens.lens (\ExecuteStatement' {workgroupName} -> workgroupName) (\s@ExecuteStatement' {} a -> s {workgroupName = a} :: ExecuteStatement)++-- | The name of the database. This parameter is required when authenticating+-- using either Secrets Manager or temporary credentials.+executeStatement_database :: Lens.Lens' ExecuteStatement Prelude.Text+executeStatement_database = Lens.lens (\ExecuteStatement' {database} -> database) (\s@ExecuteStatement' {} a -> s {database = a} :: ExecuteStatement)++-- | The SQL statement text to run.+executeStatement_sql :: Lens.Lens' ExecuteStatement Prelude.Text+executeStatement_sql = Lens.lens (\ExecuteStatement' {sql} -> sql) (\s@ExecuteStatement' {} a -> s {sql = a} :: ExecuteStatement)++instance Core.AWSRequest ExecuteStatement where+ type+ AWSResponse ExecuteStatement =+ ExecuteStatementResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ ExecuteStatementResponse'+ Prelude.<$> (x Data..?> "ClusterIdentifier")+ Prelude.<*> (x Data..?> "CreatedAt")+ Prelude.<*> (x Data..?> "Database")+ Prelude.<*> (x Data..?> "DbUser")+ Prelude.<*> (x Data..?> "Id")+ Prelude.<*> (x Data..?> "SecretArn")+ Prelude.<*> (x Data..?> "WorkgroupName")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable ExecuteStatement where+ hashWithSalt _salt ExecuteStatement' {..} =+ _salt+ `Prelude.hashWithSalt` clientToken+ `Prelude.hashWithSalt` clusterIdentifier+ `Prelude.hashWithSalt` dbUser+ `Prelude.hashWithSalt` parameters+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` statementName+ `Prelude.hashWithSalt` withEvent+ `Prelude.hashWithSalt` workgroupName+ `Prelude.hashWithSalt` database+ `Prelude.hashWithSalt` sql++instance Prelude.NFData ExecuteStatement where+ rnf ExecuteStatement' {..} =+ Prelude.rnf clientToken+ `Prelude.seq` Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf parameters+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf statementName+ `Prelude.seq` Prelude.rnf withEvent+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf database+ `Prelude.seq` Prelude.rnf sql++instance Data.ToHeaders ExecuteStatement where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ( "RedshiftData.ExecuteStatement" ::+ Prelude.ByteString+ ),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON ExecuteStatement where+ toJSON ExecuteStatement' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ClientToken" Data..=) Prelude.<$> clientToken,+ ("ClusterIdentifier" Data..=)+ Prelude.<$> clusterIdentifier,+ ("DbUser" Data..=) Prelude.<$> dbUser,+ ("Parameters" Data..=) Prelude.<$> parameters,+ ("SecretArn" Data..=) Prelude.<$> secretArn,+ ("StatementName" Data..=) Prelude.<$> statementName,+ ("WithEvent" Data..=) Prelude.<$> withEvent,+ ("WorkgroupName" Data..=) Prelude.<$> workgroupName,+ Prelude.Just ("Database" Data..= database),+ Prelude.Just ("Sql" Data..= sql)+ ]+ )++instance Data.ToPath ExecuteStatement where+ toPath = Prelude.const "/"++instance Data.ToQuery ExecuteStatement where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newExecuteStatementResponse' smart constructor.+data ExecuteStatementResponse = ExecuteStatementResponse'+ { -- | The cluster identifier. This element is not returned when connecting to+ -- a serverless workgroup.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | The date and time (UTC) the statement was created.+ createdAt :: Prelude.Maybe Data.POSIX,+ -- | The name of the database.+ database :: Prelude.Maybe Prelude.Text,+ -- | The database user name.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The identifier of the SQL statement whose results are to be fetched.+ -- This value is a universally unique identifier (UUID) generated by Amazon+ -- Redshift Data API.+ id :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The serverless workgroup name. This element is not returned when+ -- connecting to a provisioned cluster.+ workgroupName :: 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 'ExecuteStatementResponse' 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:+--+-- 'clusterIdentifier', 'executeStatementResponse_clusterIdentifier' - The cluster identifier. This element is not returned when connecting to+-- a serverless workgroup.+--+-- 'createdAt', 'executeStatementResponse_createdAt' - The date and time (UTC) the statement was created.+--+-- 'database', 'executeStatementResponse_database' - The name of the database.+--+-- 'dbUser', 'executeStatementResponse_dbUser' - The database user name.+--+-- 'id', 'executeStatementResponse_id' - The identifier of the SQL statement whose results are to be fetched.+-- This value is a universally unique identifier (UUID) generated by Amazon+-- Redshift Data API.+--+-- 'secretArn', 'executeStatementResponse_secretArn' - The name or ARN of the secret that enables access to the database.+--+-- 'workgroupName', 'executeStatementResponse_workgroupName' - The serverless workgroup name. This element is not returned when+-- connecting to a provisioned cluster.+--+-- 'httpStatus', 'executeStatementResponse_httpStatus' - The response's http status code.+newExecuteStatementResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ ExecuteStatementResponse+newExecuteStatementResponse pHttpStatus_ =+ ExecuteStatementResponse'+ { clusterIdentifier =+ Prelude.Nothing,+ createdAt = Prelude.Nothing,+ database = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ id = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | The cluster identifier. This element is not returned when connecting to+-- a serverless workgroup.+executeStatementResponse_clusterIdentifier :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.Text)+executeStatementResponse_clusterIdentifier = Lens.lens (\ExecuteStatementResponse' {clusterIdentifier} -> clusterIdentifier) (\s@ExecuteStatementResponse' {} a -> s {clusterIdentifier = a} :: ExecuteStatementResponse)++-- | The date and time (UTC) the statement was created.+executeStatementResponse_createdAt :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.UTCTime)+executeStatementResponse_createdAt = Lens.lens (\ExecuteStatementResponse' {createdAt} -> createdAt) (\s@ExecuteStatementResponse' {} a -> s {createdAt = a} :: ExecuteStatementResponse) Prelude.. Lens.mapping Data._Time++-- | The name of the database.+executeStatementResponse_database :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.Text)+executeStatementResponse_database = Lens.lens (\ExecuteStatementResponse' {database} -> database) (\s@ExecuteStatementResponse' {} a -> s {database = a} :: ExecuteStatementResponse)++-- | The database user name.+executeStatementResponse_dbUser :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.Text)+executeStatementResponse_dbUser = Lens.lens (\ExecuteStatementResponse' {dbUser} -> dbUser) (\s@ExecuteStatementResponse' {} a -> s {dbUser = a} :: ExecuteStatementResponse)++-- | The identifier of the SQL statement whose results are to be fetched.+-- This value is a universally unique identifier (UUID) generated by Amazon+-- Redshift Data API.+executeStatementResponse_id :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.Text)+executeStatementResponse_id = Lens.lens (\ExecuteStatementResponse' {id} -> id) (\s@ExecuteStatementResponse' {} a -> s {id = a} :: ExecuteStatementResponse)++-- | The name or ARN of the secret that enables access to the database.+executeStatementResponse_secretArn :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.Text)+executeStatementResponse_secretArn = Lens.lens (\ExecuteStatementResponse' {secretArn} -> secretArn) (\s@ExecuteStatementResponse' {} a -> s {secretArn = a} :: ExecuteStatementResponse)++-- | The serverless workgroup name. This element is not returned when+-- connecting to a provisioned cluster.+executeStatementResponse_workgroupName :: Lens.Lens' ExecuteStatementResponse (Prelude.Maybe Prelude.Text)+executeStatementResponse_workgroupName = Lens.lens (\ExecuteStatementResponse' {workgroupName} -> workgroupName) (\s@ExecuteStatementResponse' {} a -> s {workgroupName = a} :: ExecuteStatementResponse)++-- | The response's http status code.+executeStatementResponse_httpStatus :: Lens.Lens' ExecuteStatementResponse Prelude.Int+executeStatementResponse_httpStatus = Lens.lens (\ExecuteStatementResponse' {httpStatus} -> httpStatus) (\s@ExecuteStatementResponse' {} a -> s {httpStatus = a} :: ExecuteStatementResponse)++instance Prelude.NFData ExecuteStatementResponse where+ rnf ExecuteStatementResponse' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf createdAt+ `Prelude.seq` Prelude.rnf database+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf id+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/GetStatementResult.hs view
@@ -0,0 +1,302 @@+{-# 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.RedshiftData.GetStatementResult+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Fetches the temporarily cached result of an SQL statement. A token is+-- returned to page through the statement results.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+--+-- This operation returns paginated results.+module Amazonka.RedshiftData.GetStatementResult+ ( -- * Creating a Request+ GetStatementResult (..),+ newGetStatementResult,++ -- * Request Lenses+ getStatementResult_nextToken,+ getStatementResult_id,++ -- * Destructuring the Response+ GetStatementResultResponse (..),+ newGetStatementResultResponse,++ -- * Response Lenses+ getStatementResultResponse_columnMetadata,+ getStatementResultResponse_nextToken,+ getStatementResultResponse_totalNumRows,+ getStatementResultResponse_httpStatus,+ getStatementResultResponse_records,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newGetStatementResult' smart constructor.+data GetStatementResult = GetStatementResult'+ { -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The identifier of the SQL statement whose results are to be fetched.+ -- This value is a universally unique identifier (UUID) generated by Amazon+ -- Redshift Data API. A suffix indicates then number of the SQL statement.+ -- For example, @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of+ -- @:2@ that indicates the second SQL statement of a batch query. This+ -- identifier is returned by @BatchExecuteStatment@, @ExecuteStatment@, and+ -- @ListStatements@.+ id :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'GetStatementResult' 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:+--+-- 'nextToken', 'getStatementResult_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'id', 'getStatementResult_id' - The identifier of the SQL statement whose results are to be fetched.+-- This value is a universally unique identifier (UUID) generated by Amazon+-- Redshift Data API. A suffix indicates then number of the SQL statement.+-- For example, @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of+-- @:2@ that indicates the second SQL statement of a batch query. This+-- identifier is returned by @BatchExecuteStatment@, @ExecuteStatment@, and+-- @ListStatements@.+newGetStatementResult ::+ -- | 'id'+ Prelude.Text ->+ GetStatementResult+newGetStatementResult pId_ =+ GetStatementResult'+ { nextToken = Prelude.Nothing,+ id = pId_+ }++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+getStatementResult_nextToken :: Lens.Lens' GetStatementResult (Prelude.Maybe Prelude.Text)+getStatementResult_nextToken = Lens.lens (\GetStatementResult' {nextToken} -> nextToken) (\s@GetStatementResult' {} a -> s {nextToken = a} :: GetStatementResult)++-- | The identifier of the SQL statement whose results are to be fetched.+-- This value is a universally unique identifier (UUID) generated by Amazon+-- Redshift Data API. A suffix indicates then number of the SQL statement.+-- For example, @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of+-- @:2@ that indicates the second SQL statement of a batch query. This+-- identifier is returned by @BatchExecuteStatment@, @ExecuteStatment@, and+-- @ListStatements@.+getStatementResult_id :: Lens.Lens' GetStatementResult Prelude.Text+getStatementResult_id = Lens.lens (\GetStatementResult' {id} -> id) (\s@GetStatementResult' {} a -> s {id = a} :: GetStatementResult)++instance Core.AWSPager GetStatementResult where+ page rq rs+ | Core.stop+ ( rs+ Lens.^? getStatementResultResponse_nextToken+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Core.stop+ (rs Lens.^. getStatementResultResponse_records) =+ Prelude.Nothing+ | Prelude.otherwise =+ Prelude.Just+ Prelude.$ rq+ Prelude.& getStatementResult_nextToken+ Lens..~ rs+ Lens.^? getStatementResultResponse_nextToken+ Prelude.. Lens._Just++instance Core.AWSRequest GetStatementResult where+ type+ AWSResponse GetStatementResult =+ GetStatementResultResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ GetStatementResultResponse'+ Prelude.<$> (x Data..?> "ColumnMetadata" Core..!@ Prelude.mempty)+ Prelude.<*> (x Data..?> "NextToken")+ Prelude.<*> (x Data..?> "TotalNumRows")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ Prelude.<*> (x Data..?> "Records" Core..!@ Prelude.mempty)+ )++instance Prelude.Hashable GetStatementResult where+ hashWithSalt _salt GetStatementResult' {..} =+ _salt+ `Prelude.hashWithSalt` nextToken+ `Prelude.hashWithSalt` id++instance Prelude.NFData GetStatementResult where+ rnf GetStatementResult' {..} =+ Prelude.rnf nextToken `Prelude.seq` Prelude.rnf id++instance Data.ToHeaders GetStatementResult where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ( "RedshiftData.GetStatementResult" ::+ Prelude.ByteString+ ),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON GetStatementResult where+ toJSON GetStatementResult' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("NextToken" Data..=) Prelude.<$> nextToken,+ Prelude.Just ("Id" Data..= id)+ ]+ )++instance Data.ToPath GetStatementResult where+ toPath = Prelude.const "/"++instance Data.ToQuery GetStatementResult where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newGetStatementResultResponse' smart constructor.+data GetStatementResultResponse = GetStatementResultResponse'+ { -- | The properties (metadata) of a column.+ columnMetadata :: Prelude.Maybe [ColumnMetadata],+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The total number of rows in the result set returned from a query. You+ -- can use this number to estimate the number of calls to the+ -- @GetStatementResult@ operation needed to page through the results.+ totalNumRows :: Prelude.Maybe Prelude.Integer,+ -- | The response's http status code.+ httpStatus :: Prelude.Int,+ -- | The results of the SQL statement.+ records :: [[Field]]+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'GetStatementResultResponse' 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:+--+-- 'columnMetadata', 'getStatementResultResponse_columnMetadata' - The properties (metadata) of a column.+--+-- 'nextToken', 'getStatementResultResponse_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'totalNumRows', 'getStatementResultResponse_totalNumRows' - The total number of rows in the result set returned from a query. You+-- can use this number to estimate the number of calls to the+-- @GetStatementResult@ operation needed to page through the results.+--+-- 'httpStatus', 'getStatementResultResponse_httpStatus' - The response's http status code.+--+-- 'records', 'getStatementResultResponse_records' - The results of the SQL statement.+newGetStatementResultResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ GetStatementResultResponse+newGetStatementResultResponse pHttpStatus_ =+ GetStatementResultResponse'+ { columnMetadata =+ Prelude.Nothing,+ nextToken = Prelude.Nothing,+ totalNumRows = Prelude.Nothing,+ httpStatus = pHttpStatus_,+ records = Prelude.mempty+ }++-- | The properties (metadata) of a column.+getStatementResultResponse_columnMetadata :: Lens.Lens' GetStatementResultResponse (Prelude.Maybe [ColumnMetadata])+getStatementResultResponse_columnMetadata = Lens.lens (\GetStatementResultResponse' {columnMetadata} -> columnMetadata) (\s@GetStatementResultResponse' {} a -> s {columnMetadata = a} :: GetStatementResultResponse) Prelude.. Lens.mapping Lens.coerced++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+getStatementResultResponse_nextToken :: Lens.Lens' GetStatementResultResponse (Prelude.Maybe Prelude.Text)+getStatementResultResponse_nextToken = Lens.lens (\GetStatementResultResponse' {nextToken} -> nextToken) (\s@GetStatementResultResponse' {} a -> s {nextToken = a} :: GetStatementResultResponse)++-- | The total number of rows in the result set returned from a query. You+-- can use this number to estimate the number of calls to the+-- @GetStatementResult@ operation needed to page through the results.+getStatementResultResponse_totalNumRows :: Lens.Lens' GetStatementResultResponse (Prelude.Maybe Prelude.Integer)+getStatementResultResponse_totalNumRows = Lens.lens (\GetStatementResultResponse' {totalNumRows} -> totalNumRows) (\s@GetStatementResultResponse' {} a -> s {totalNumRows = a} :: GetStatementResultResponse)++-- | The response's http status code.+getStatementResultResponse_httpStatus :: Lens.Lens' GetStatementResultResponse Prelude.Int+getStatementResultResponse_httpStatus = Lens.lens (\GetStatementResultResponse' {httpStatus} -> httpStatus) (\s@GetStatementResultResponse' {} a -> s {httpStatus = a} :: GetStatementResultResponse)++-- | The results of the SQL statement.+getStatementResultResponse_records :: Lens.Lens' GetStatementResultResponse [[Field]]+getStatementResultResponse_records = Lens.lens (\GetStatementResultResponse' {records} -> records) (\s@GetStatementResultResponse' {} a -> s {records = a} :: GetStatementResultResponse) Prelude.. Lens.coerced++instance Prelude.NFData GetStatementResultResponse where+ rnf GetStatementResultResponse' {..} =+ Prelude.rnf columnMetadata+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf totalNumRows+ `Prelude.seq` Prelude.rnf httpStatus+ `Prelude.seq` Prelude.rnf records
+ gen/Amazonka/RedshiftData/Lens.hs view
@@ -0,0 +1,236 @@+{-# 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.RedshiftData.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.RedshiftData.Lens+ ( -- * Operations++ -- ** BatchExecuteStatement+ batchExecuteStatement_clientToken,+ batchExecuteStatement_clusterIdentifier,+ batchExecuteStatement_dbUser,+ batchExecuteStatement_secretArn,+ batchExecuteStatement_statementName,+ batchExecuteStatement_withEvent,+ batchExecuteStatement_workgroupName,+ batchExecuteStatement_database,+ batchExecuteStatement_sqls,+ batchExecuteStatementResponse_clusterIdentifier,+ batchExecuteStatementResponse_createdAt,+ batchExecuteStatementResponse_database,+ batchExecuteStatementResponse_dbUser,+ batchExecuteStatementResponse_id,+ batchExecuteStatementResponse_secretArn,+ batchExecuteStatementResponse_workgroupName,+ batchExecuteStatementResponse_httpStatus,++ -- ** CancelStatement+ cancelStatement_id,+ cancelStatementResponse_status,+ cancelStatementResponse_httpStatus,++ -- ** DescribeStatement+ describeStatement_id,+ describeStatementResponse_clusterIdentifier,+ describeStatementResponse_createdAt,+ describeStatementResponse_database,+ describeStatementResponse_dbUser,+ describeStatementResponse_duration,+ describeStatementResponse_error,+ describeStatementResponse_hasResultSet,+ describeStatementResponse_queryParameters,+ describeStatementResponse_queryString,+ describeStatementResponse_redshiftPid,+ describeStatementResponse_redshiftQueryId,+ describeStatementResponse_resultRows,+ describeStatementResponse_resultSize,+ describeStatementResponse_secretArn,+ describeStatementResponse_status,+ describeStatementResponse_subStatements,+ describeStatementResponse_updatedAt,+ describeStatementResponse_workgroupName,+ describeStatementResponse_httpStatus,+ describeStatementResponse_id,++ -- ** DescribeTable+ describeTable_clusterIdentifier,+ describeTable_connectedDatabase,+ describeTable_dbUser,+ describeTable_maxResults,+ describeTable_nextToken,+ describeTable_schema,+ describeTable_secretArn,+ describeTable_table,+ describeTable_workgroupName,+ describeTable_database,+ describeTableResponse_columnList,+ describeTableResponse_nextToken,+ describeTableResponse_tableName,+ describeTableResponse_httpStatus,++ -- ** ExecuteStatement+ executeStatement_clientToken,+ executeStatement_clusterIdentifier,+ executeStatement_dbUser,+ executeStatement_parameters,+ executeStatement_secretArn,+ executeStatement_statementName,+ executeStatement_withEvent,+ executeStatement_workgroupName,+ executeStatement_database,+ executeStatement_sql,+ executeStatementResponse_clusterIdentifier,+ executeStatementResponse_createdAt,+ executeStatementResponse_database,+ executeStatementResponse_dbUser,+ executeStatementResponse_id,+ executeStatementResponse_secretArn,+ executeStatementResponse_workgroupName,+ executeStatementResponse_httpStatus,++ -- ** GetStatementResult+ getStatementResult_nextToken,+ getStatementResult_id,+ getStatementResultResponse_columnMetadata,+ getStatementResultResponse_nextToken,+ getStatementResultResponse_totalNumRows,+ getStatementResultResponse_httpStatus,+ getStatementResultResponse_records,++ -- ** ListDatabases+ listDatabases_clusterIdentifier,+ listDatabases_dbUser,+ listDatabases_maxResults,+ listDatabases_nextToken,+ listDatabases_secretArn,+ listDatabases_workgroupName,+ listDatabases_database,+ listDatabasesResponse_databases,+ listDatabasesResponse_nextToken,+ listDatabasesResponse_httpStatus,++ -- ** ListSchemas+ listSchemas_clusterIdentifier,+ listSchemas_connectedDatabase,+ listSchemas_dbUser,+ listSchemas_maxResults,+ listSchemas_nextToken,+ listSchemas_schemaPattern,+ listSchemas_secretArn,+ listSchemas_workgroupName,+ listSchemas_database,+ listSchemasResponse_nextToken,+ listSchemasResponse_schemas,+ listSchemasResponse_httpStatus,++ -- ** ListStatements+ listStatements_maxResults,+ listStatements_nextToken,+ listStatements_roleLevel,+ listStatements_statementName,+ listStatements_status,+ listStatementsResponse_nextToken,+ listStatementsResponse_httpStatus,+ listStatementsResponse_statements,++ -- ** ListTables+ listTables_clusterIdentifier,+ listTables_connectedDatabase,+ listTables_dbUser,+ listTables_maxResults,+ listTables_nextToken,+ listTables_schemaPattern,+ listTables_secretArn,+ listTables_tablePattern,+ listTables_workgroupName,+ listTables_database,+ listTablesResponse_nextToken,+ listTablesResponse_tables,+ listTablesResponse_httpStatus,++ -- * Types++ -- ** ColumnMetadata+ columnMetadata_columnDefault,+ columnMetadata_isCaseSensitive,+ columnMetadata_isCurrency,+ columnMetadata_isSigned,+ columnMetadata_label,+ columnMetadata_length,+ columnMetadata_name,+ columnMetadata_nullable,+ columnMetadata_precision,+ columnMetadata_scale,+ columnMetadata_schemaName,+ columnMetadata_tableName,+ columnMetadata_typeName,++ -- ** Field+ field_blobValue,+ field_booleanValue,+ field_doubleValue,+ field_isNull,+ field_longValue,+ field_stringValue,++ -- ** SqlParameter+ sqlParameter_name,+ sqlParameter_value,++ -- ** StatementData+ statementData_createdAt,+ statementData_isBatchStatement,+ statementData_queryParameters,+ statementData_queryString,+ statementData_queryStrings,+ statementData_secretArn,+ statementData_statementName,+ statementData_status,+ statementData_updatedAt,+ statementData_id,++ -- ** SubStatementData+ subStatementData_createdAt,+ subStatementData_duration,+ subStatementData_error,+ subStatementData_hasResultSet,+ subStatementData_queryString,+ subStatementData_redshiftQueryId,+ subStatementData_resultRows,+ subStatementData_resultSize,+ subStatementData_status,+ subStatementData_updatedAt,+ subStatementData_id,++ -- ** TableMember+ tableMember_name,+ tableMember_schema,+ tableMember_type,+ )+where++import Amazonka.RedshiftData.BatchExecuteStatement+import Amazonka.RedshiftData.CancelStatement+import Amazonka.RedshiftData.DescribeStatement+import Amazonka.RedshiftData.DescribeTable+import Amazonka.RedshiftData.ExecuteStatement+import Amazonka.RedshiftData.GetStatementResult+import Amazonka.RedshiftData.ListDatabases+import Amazonka.RedshiftData.ListSchemas+import Amazonka.RedshiftData.ListStatements+import Amazonka.RedshiftData.ListTables+import Amazonka.RedshiftData.Types.ColumnMetadata+import Amazonka.RedshiftData.Types.Field+import Amazonka.RedshiftData.Types.SqlParameter+import Amazonka.RedshiftData.Types.StatementData+import Amazonka.RedshiftData.Types.SubStatementData+import Amazonka.RedshiftData.Types.TableMember
+ gen/Amazonka/RedshiftData/ListDatabases.hs view
@@ -0,0 +1,362 @@+{-# 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.RedshiftData.ListDatabases+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- List the databases in a cluster. A token is returned to page through the+-- database list. Depending on the authorization method, use one of the+-- following combinations of request parameters:+--+-- - Secrets Manager - when connecting to a cluster, specify the Amazon+-- Resource Name (ARN) of the secret, the database name, and the+-- cluster identifier that matches the cluster in the secret. When+-- connecting to a serverless workgroup, specify the Amazon Resource+-- Name (ARN) of the secret and the database name.+--+-- - Temporary credentials - when connecting to a cluster, specify the+-- cluster identifier, the database name, and the database user name.+-- Also, permission to call the @redshift:GetClusterCredentials@+-- operation is required. When connecting to a serverless workgroup,+-- specify the workgroup name and database name. Also, permission to+-- call the @redshift-serverless:GetCredentials@ operation is required.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+--+-- This operation returns paginated results.+module Amazonka.RedshiftData.ListDatabases+ ( -- * Creating a Request+ ListDatabases (..),+ newListDatabases,++ -- * Request Lenses+ listDatabases_clusterIdentifier,+ listDatabases_dbUser,+ listDatabases_maxResults,+ listDatabases_nextToken,+ listDatabases_secretArn,+ listDatabases_workgroupName,+ listDatabases_database,++ -- * Destructuring the Response+ ListDatabasesResponse (..),+ newListDatabasesResponse,++ -- * Response Lenses+ listDatabasesResponse_databases,+ listDatabasesResponse_nextToken,+ listDatabasesResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newListDatabases' smart constructor.+data ListDatabases = ListDatabases'+ { -- | The cluster identifier. This parameter is required when connecting to a+ -- cluster and authenticating using either Secrets Manager or temporary+ -- credentials.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | The database user name. This parameter is required when connecting to a+ -- cluster and authenticating using temporary credentials.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The maximum number of databases to return in the response. If more+ -- databases exist than fit in one response, then @NextToken@ is returned+ -- to page through the results.+ maxResults :: Prelude.Maybe Prelude.Natural,+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database. This+ -- parameter is required when authenticating using Secrets Manager.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The serverless workgroup name. This parameter is required when+ -- connecting to a serverless workgroup and authenticating using either+ -- Secrets Manager or temporary credentials.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The name of the database. This parameter is required when authenticating+ -- using either Secrets Manager or temporary credentials.+ database :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListDatabases' 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:+--+-- 'clusterIdentifier', 'listDatabases_clusterIdentifier' - The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+--+-- 'dbUser', 'listDatabases_dbUser' - The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+--+-- 'maxResults', 'listDatabases_maxResults' - The maximum number of databases to return in the response. If more+-- databases exist than fit in one response, then @NextToken@ is returned+-- to page through the results.+--+-- 'nextToken', 'listDatabases_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'secretArn', 'listDatabases_secretArn' - The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+--+-- 'workgroupName', 'listDatabases_workgroupName' - The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+--+-- 'database', 'listDatabases_database' - The name of the database. This parameter is required when authenticating+-- using either Secrets Manager or temporary credentials.+newListDatabases ::+ -- | 'database'+ Prelude.Text ->+ ListDatabases+newListDatabases pDatabase_ =+ ListDatabases'+ { clusterIdentifier = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ maxResults = Prelude.Nothing,+ nextToken = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ database = pDatabase_+ }++-- | The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+listDatabases_clusterIdentifier :: Lens.Lens' ListDatabases (Prelude.Maybe Prelude.Text)+listDatabases_clusterIdentifier = Lens.lens (\ListDatabases' {clusterIdentifier} -> clusterIdentifier) (\s@ListDatabases' {} a -> s {clusterIdentifier = a} :: ListDatabases)++-- | The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+listDatabases_dbUser :: Lens.Lens' ListDatabases (Prelude.Maybe Prelude.Text)+listDatabases_dbUser = Lens.lens (\ListDatabases' {dbUser} -> dbUser) (\s@ListDatabases' {} a -> s {dbUser = a} :: ListDatabases)++-- | The maximum number of databases to return in the response. If more+-- databases exist than fit in one response, then @NextToken@ is returned+-- to page through the results.+listDatabases_maxResults :: Lens.Lens' ListDatabases (Prelude.Maybe Prelude.Natural)+listDatabases_maxResults = Lens.lens (\ListDatabases' {maxResults} -> maxResults) (\s@ListDatabases' {} a -> s {maxResults = a} :: ListDatabases)++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listDatabases_nextToken :: Lens.Lens' ListDatabases (Prelude.Maybe Prelude.Text)+listDatabases_nextToken = Lens.lens (\ListDatabases' {nextToken} -> nextToken) (\s@ListDatabases' {} a -> s {nextToken = a} :: ListDatabases)++-- | The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+listDatabases_secretArn :: Lens.Lens' ListDatabases (Prelude.Maybe Prelude.Text)+listDatabases_secretArn = Lens.lens (\ListDatabases' {secretArn} -> secretArn) (\s@ListDatabases' {} a -> s {secretArn = a} :: ListDatabases)++-- | The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+listDatabases_workgroupName :: Lens.Lens' ListDatabases (Prelude.Maybe Prelude.Text)+listDatabases_workgroupName = Lens.lens (\ListDatabases' {workgroupName} -> workgroupName) (\s@ListDatabases' {} a -> s {workgroupName = a} :: ListDatabases)++-- | The name of the database. This parameter is required when authenticating+-- using either Secrets Manager or temporary credentials.+listDatabases_database :: Lens.Lens' ListDatabases Prelude.Text+listDatabases_database = Lens.lens (\ListDatabases' {database} -> database) (\s@ListDatabases' {} a -> s {database = a} :: ListDatabases)++instance Core.AWSPager ListDatabases where+ page rq rs+ | Core.stop+ ( rs+ Lens.^? listDatabasesResponse_nextToken+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Core.stop+ ( rs+ Lens.^? listDatabasesResponse_databases+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Prelude.otherwise =+ Prelude.Just+ Prelude.$ rq+ Prelude.& listDatabases_nextToken+ Lens..~ rs+ Lens.^? listDatabasesResponse_nextToken+ Prelude.. Lens._Just++instance Core.AWSRequest ListDatabases where+ type+ AWSResponse ListDatabases =+ ListDatabasesResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ ListDatabasesResponse'+ Prelude.<$> (x Data..?> "Databases" Core..!@ Prelude.mempty)+ Prelude.<*> (x Data..?> "NextToken")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable ListDatabases where+ hashWithSalt _salt ListDatabases' {..} =+ _salt+ `Prelude.hashWithSalt` clusterIdentifier+ `Prelude.hashWithSalt` dbUser+ `Prelude.hashWithSalt` maxResults+ `Prelude.hashWithSalt` nextToken+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` workgroupName+ `Prelude.hashWithSalt` database++instance Prelude.NFData ListDatabases where+ rnf ListDatabases' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf maxResults+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf database++instance Data.ToHeaders ListDatabases where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ("RedshiftData.ListDatabases" :: Prelude.ByteString),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON ListDatabases where+ toJSON ListDatabases' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ClusterIdentifier" Data..=)+ Prelude.<$> clusterIdentifier,+ ("DbUser" Data..=) Prelude.<$> dbUser,+ ("MaxResults" Data..=) Prelude.<$> maxResults,+ ("NextToken" Data..=) Prelude.<$> nextToken,+ ("SecretArn" Data..=) Prelude.<$> secretArn,+ ("WorkgroupName" Data..=) Prelude.<$> workgroupName,+ Prelude.Just ("Database" Data..= database)+ ]+ )++instance Data.ToPath ListDatabases where+ toPath = Prelude.const "/"++instance Data.ToQuery ListDatabases where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newListDatabasesResponse' smart constructor.+data ListDatabasesResponse = ListDatabasesResponse'+ { -- | The names of databases.+ databases :: Prelude.Maybe [Prelude.Text],+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: 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 'ListDatabasesResponse' 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:+--+-- 'databases', 'listDatabasesResponse_databases' - The names of databases.+--+-- 'nextToken', 'listDatabasesResponse_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'httpStatus', 'listDatabasesResponse_httpStatus' - The response's http status code.+newListDatabasesResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ ListDatabasesResponse+newListDatabasesResponse pHttpStatus_ =+ ListDatabasesResponse'+ { databases = Prelude.Nothing,+ nextToken = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | The names of databases.+listDatabasesResponse_databases :: Lens.Lens' ListDatabasesResponse (Prelude.Maybe [Prelude.Text])+listDatabasesResponse_databases = Lens.lens (\ListDatabasesResponse' {databases} -> databases) (\s@ListDatabasesResponse' {} a -> s {databases = a} :: ListDatabasesResponse) Prelude.. Lens.mapping Lens.coerced++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listDatabasesResponse_nextToken :: Lens.Lens' ListDatabasesResponse (Prelude.Maybe Prelude.Text)+listDatabasesResponse_nextToken = Lens.lens (\ListDatabasesResponse' {nextToken} -> nextToken) (\s@ListDatabasesResponse' {} a -> s {nextToken = a} :: ListDatabasesResponse)++-- | The response's http status code.+listDatabasesResponse_httpStatus :: Lens.Lens' ListDatabasesResponse Prelude.Int+listDatabasesResponse_httpStatus = Lens.lens (\ListDatabasesResponse' {httpStatus} -> httpStatus) (\s@ListDatabasesResponse' {} a -> s {httpStatus = a} :: ListDatabasesResponse)++instance Prelude.NFData ListDatabasesResponse where+ rnf ListDatabasesResponse' {..} =+ Prelude.rnf databases+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/ListSchemas.hs view
@@ -0,0 +1,402 @@+{-# 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.RedshiftData.ListSchemas+-- 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 schemas in a database. A token is returned to page through the+-- schema list. Depending on the authorization method, use one of the+-- following combinations of request parameters:+--+-- - Secrets Manager - when connecting to a cluster, specify the Amazon+-- Resource Name (ARN) of the secret, the database name, and the+-- cluster identifier that matches the cluster in the secret. When+-- connecting to a serverless workgroup, specify the Amazon Resource+-- Name (ARN) of the secret and the database name.+--+-- - Temporary credentials - when connecting to a cluster, specify the+-- cluster identifier, the database name, and the database user name.+-- Also, permission to call the @redshift:GetClusterCredentials@+-- operation is required. When connecting to a serverless workgroup,+-- specify the workgroup name and database name. Also, permission to+-- call the @redshift-serverless:GetCredentials@ operation is required.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+--+-- This operation returns paginated results.+module Amazonka.RedshiftData.ListSchemas+ ( -- * Creating a Request+ ListSchemas (..),+ newListSchemas,++ -- * Request Lenses+ listSchemas_clusterIdentifier,+ listSchemas_connectedDatabase,+ listSchemas_dbUser,+ listSchemas_maxResults,+ listSchemas_nextToken,+ listSchemas_schemaPattern,+ listSchemas_secretArn,+ listSchemas_workgroupName,+ listSchemas_database,++ -- * Destructuring the Response+ ListSchemasResponse (..),+ newListSchemasResponse,++ -- * Response Lenses+ listSchemasResponse_nextToken,+ listSchemasResponse_schemas,+ listSchemasResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newListSchemas' smart constructor.+data ListSchemas = ListSchemas'+ { -- | The cluster identifier. This parameter is required when connecting to a+ -- cluster and authenticating using either Secrets Manager or temporary+ -- credentials.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | A database name. The connected database is specified when you connect+ -- with your authentication credentials.+ connectedDatabase :: Prelude.Maybe Prelude.Text,+ -- | The database user name. This parameter is required when connecting to a+ -- cluster and authenticating using temporary credentials.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The maximum number of schemas to return in the response. If more schemas+ -- exist than fit in one response, then @NextToken@ is returned to page+ -- through the results.+ maxResults :: Prelude.Maybe Prelude.Natural,+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | A pattern to filter results by schema name. Within a schema pattern,+ -- \"%\" means match any substring of 0 or more characters and \"_\" means+ -- match any one character. Only schema name entries matching the search+ -- pattern are returned.+ schemaPattern :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database. This+ -- parameter is required when authenticating using Secrets Manager.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The serverless workgroup name. This parameter is required when+ -- connecting to a serverless workgroup and authenticating using either+ -- Secrets Manager or temporary credentials.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The name of the database that contains the schemas to list. If+ -- @ConnectedDatabase@ is not specified, this is also the database to+ -- connect to with your authentication credentials.+ database :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListSchemas' 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:+--+-- 'clusterIdentifier', 'listSchemas_clusterIdentifier' - The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+--+-- 'connectedDatabase', 'listSchemas_connectedDatabase' - A database name. The connected database is specified when you connect+-- with your authentication credentials.+--+-- 'dbUser', 'listSchemas_dbUser' - The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+--+-- 'maxResults', 'listSchemas_maxResults' - The maximum number of schemas to return in the response. If more schemas+-- exist than fit in one response, then @NextToken@ is returned to page+-- through the results.+--+-- 'nextToken', 'listSchemas_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'schemaPattern', 'listSchemas_schemaPattern' - A pattern to filter results by schema name. Within a schema pattern,+-- \"%\" means match any substring of 0 or more characters and \"_\" means+-- match any one character. Only schema name entries matching the search+-- pattern are returned.+--+-- 'secretArn', 'listSchemas_secretArn' - The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+--+-- 'workgroupName', 'listSchemas_workgroupName' - The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+--+-- 'database', 'listSchemas_database' - The name of the database that contains the schemas to list. If+-- @ConnectedDatabase@ is not specified, this is also the database to+-- connect to with your authentication credentials.+newListSchemas ::+ -- | 'database'+ Prelude.Text ->+ ListSchemas+newListSchemas pDatabase_ =+ ListSchemas'+ { clusterIdentifier = Prelude.Nothing,+ connectedDatabase = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ maxResults = Prelude.Nothing,+ nextToken = Prelude.Nothing,+ schemaPattern = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ database = pDatabase_+ }++-- | The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+listSchemas_clusterIdentifier :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_clusterIdentifier = Lens.lens (\ListSchemas' {clusterIdentifier} -> clusterIdentifier) (\s@ListSchemas' {} a -> s {clusterIdentifier = a} :: ListSchemas)++-- | A database name. The connected database is specified when you connect+-- with your authentication credentials.+listSchemas_connectedDatabase :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_connectedDatabase = Lens.lens (\ListSchemas' {connectedDatabase} -> connectedDatabase) (\s@ListSchemas' {} a -> s {connectedDatabase = a} :: ListSchemas)++-- | The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+listSchemas_dbUser :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_dbUser = Lens.lens (\ListSchemas' {dbUser} -> dbUser) (\s@ListSchemas' {} a -> s {dbUser = a} :: ListSchemas)++-- | The maximum number of schemas to return in the response. If more schemas+-- exist than fit in one response, then @NextToken@ is returned to page+-- through the results.+listSchemas_maxResults :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Natural)+listSchemas_maxResults = Lens.lens (\ListSchemas' {maxResults} -> maxResults) (\s@ListSchemas' {} a -> s {maxResults = a} :: ListSchemas)++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listSchemas_nextToken :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_nextToken = Lens.lens (\ListSchemas' {nextToken} -> nextToken) (\s@ListSchemas' {} a -> s {nextToken = a} :: ListSchemas)++-- | A pattern to filter results by schema name. Within a schema pattern,+-- \"%\" means match any substring of 0 or more characters and \"_\" means+-- match any one character. Only schema name entries matching the search+-- pattern are returned.+listSchemas_schemaPattern :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_schemaPattern = Lens.lens (\ListSchemas' {schemaPattern} -> schemaPattern) (\s@ListSchemas' {} a -> s {schemaPattern = a} :: ListSchemas)++-- | The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+listSchemas_secretArn :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_secretArn = Lens.lens (\ListSchemas' {secretArn} -> secretArn) (\s@ListSchemas' {} a -> s {secretArn = a} :: ListSchemas)++-- | The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+listSchemas_workgroupName :: Lens.Lens' ListSchemas (Prelude.Maybe Prelude.Text)+listSchemas_workgroupName = Lens.lens (\ListSchemas' {workgroupName} -> workgroupName) (\s@ListSchemas' {} a -> s {workgroupName = a} :: ListSchemas)++-- | The name of the database that contains the schemas to list. If+-- @ConnectedDatabase@ is not specified, this is also the database to+-- connect to with your authentication credentials.+listSchemas_database :: Lens.Lens' ListSchemas Prelude.Text+listSchemas_database = Lens.lens (\ListSchemas' {database} -> database) (\s@ListSchemas' {} a -> s {database = a} :: ListSchemas)++instance Core.AWSPager ListSchemas where+ page rq rs+ | Core.stop+ ( rs+ Lens.^? listSchemasResponse_nextToken+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Core.stop+ ( rs+ Lens.^? listSchemasResponse_schemas+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Prelude.otherwise =+ Prelude.Just+ Prelude.$ rq+ Prelude.& listSchemas_nextToken+ Lens..~ rs+ Lens.^? listSchemasResponse_nextToken+ Prelude.. Lens._Just++instance Core.AWSRequest ListSchemas where+ type AWSResponse ListSchemas = ListSchemasResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ ListSchemasResponse'+ Prelude.<$> (x Data..?> "NextToken")+ Prelude.<*> (x Data..?> "Schemas" Core..!@ Prelude.mempty)+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable ListSchemas where+ hashWithSalt _salt ListSchemas' {..} =+ _salt+ `Prelude.hashWithSalt` clusterIdentifier+ `Prelude.hashWithSalt` connectedDatabase+ `Prelude.hashWithSalt` dbUser+ `Prelude.hashWithSalt` maxResults+ `Prelude.hashWithSalt` nextToken+ `Prelude.hashWithSalt` schemaPattern+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` workgroupName+ `Prelude.hashWithSalt` database++instance Prelude.NFData ListSchemas where+ rnf ListSchemas' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf connectedDatabase+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf maxResults+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf schemaPattern+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf database++instance Data.ToHeaders ListSchemas where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ("RedshiftData.ListSchemas" :: Prelude.ByteString),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON ListSchemas where+ toJSON ListSchemas' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ClusterIdentifier" Data..=)+ Prelude.<$> clusterIdentifier,+ ("ConnectedDatabase" Data..=)+ Prelude.<$> connectedDatabase,+ ("DbUser" Data..=) Prelude.<$> dbUser,+ ("MaxResults" Data..=) Prelude.<$> maxResults,+ ("NextToken" Data..=) Prelude.<$> nextToken,+ ("SchemaPattern" Data..=) Prelude.<$> schemaPattern,+ ("SecretArn" Data..=) Prelude.<$> secretArn,+ ("WorkgroupName" Data..=) Prelude.<$> workgroupName,+ Prelude.Just ("Database" Data..= database)+ ]+ )++instance Data.ToPath ListSchemas where+ toPath = Prelude.const "/"++instance Data.ToQuery ListSchemas where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newListSchemasResponse' smart constructor.+data ListSchemasResponse = ListSchemasResponse'+ { -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The schemas that match the request pattern.+ schemas :: 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 'ListSchemasResponse' 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:+--+-- 'nextToken', 'listSchemasResponse_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'schemas', 'listSchemasResponse_schemas' - The schemas that match the request pattern.+--+-- 'httpStatus', 'listSchemasResponse_httpStatus' - The response's http status code.+newListSchemasResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ ListSchemasResponse+newListSchemasResponse pHttpStatus_ =+ ListSchemasResponse'+ { nextToken = Prelude.Nothing,+ schemas = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listSchemasResponse_nextToken :: Lens.Lens' ListSchemasResponse (Prelude.Maybe Prelude.Text)+listSchemasResponse_nextToken = Lens.lens (\ListSchemasResponse' {nextToken} -> nextToken) (\s@ListSchemasResponse' {} a -> s {nextToken = a} :: ListSchemasResponse)++-- | The schemas that match the request pattern.+listSchemasResponse_schemas :: Lens.Lens' ListSchemasResponse (Prelude.Maybe [Prelude.Text])+listSchemasResponse_schemas = Lens.lens (\ListSchemasResponse' {schemas} -> schemas) (\s@ListSchemasResponse' {} a -> s {schemas = a} :: ListSchemasResponse) Prelude.. Lens.mapping Lens.coerced++-- | The response's http status code.+listSchemasResponse_httpStatus :: Lens.Lens' ListSchemasResponse Prelude.Int+listSchemasResponse_httpStatus = Lens.lens (\ListSchemasResponse' {httpStatus} -> httpStatus) (\s@ListSchemasResponse' {} a -> s {httpStatus = a} :: ListSchemasResponse)++instance Prelude.NFData ListSchemasResponse where+ rnf ListSchemasResponse' {..} =+ Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf schemas+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/ListStatements.hs view
@@ -0,0 +1,373 @@+{-# 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.RedshiftData.ListStatements+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- List of SQL statements. By default, only finished statements are shown.+-- A token is returned to page through the statement list.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+--+-- This operation returns paginated results.+module Amazonka.RedshiftData.ListStatements+ ( -- * Creating a Request+ ListStatements (..),+ newListStatements,++ -- * Request Lenses+ listStatements_maxResults,+ listStatements_nextToken,+ listStatements_roleLevel,+ listStatements_statementName,+ listStatements_status,++ -- * Destructuring the Response+ ListStatementsResponse (..),+ newListStatementsResponse,++ -- * Response Lenses+ listStatementsResponse_nextToken,+ listStatementsResponse_httpStatus,+ listStatementsResponse_statements,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newListStatements' smart constructor.+data ListStatements = ListStatements'+ { -- | The maximum number of SQL statements to return in the response. If more+ -- SQL statements exist than fit in one response, then @NextToken@ is+ -- returned to page through the results.+ maxResults :: Prelude.Maybe Prelude.Natural,+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | A value that filters which statements to return in the response. If+ -- true, all statements run by the caller\'s IAM role are returned. If+ -- false, only statements run by the caller\'s IAM role in the current IAM+ -- session are returned. The default is true.+ roleLevel :: Prelude.Maybe Prelude.Bool,+ -- | The name of the SQL statement specified as input to+ -- @BatchExecuteStatement@ or @ExecuteStatement@ to identify the query. You+ -- can list multiple statements by providing a prefix that matches the+ -- beginning of the statement name. For example, to list myStatement1,+ -- myStatement2, myStatement3, and so on, then provide the a value of+ -- @myStatement@. Data API does a case-sensitive match of SQL statement+ -- names to the prefix value you provide.+ statementName :: Prelude.Maybe Prelude.Text,+ -- | The status of the SQL statement to list. Status values are defined as+ -- follows:+ --+ -- - ABORTED - The query run was stopped by the user.+ --+ -- - ALL - A status value that includes all query statuses. This value+ -- can be used to filter results.+ --+ -- - FAILED - The query run failed.+ --+ -- - FINISHED - The query has finished running.+ --+ -- - PICKED - The query has been chosen to be run.+ --+ -- - STARTED - The query run has started.+ --+ -- - SUBMITTED - The query was submitted, but not yet processed.+ status :: Prelude.Maybe StatusString+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListStatements' 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:+--+-- 'maxResults', 'listStatements_maxResults' - The maximum number of SQL statements to return in the response. If more+-- SQL statements exist than fit in one response, then @NextToken@ is+-- returned to page through the results.+--+-- 'nextToken', 'listStatements_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'roleLevel', 'listStatements_roleLevel' - A value that filters which statements to return in the response. If+-- true, all statements run by the caller\'s IAM role are returned. If+-- false, only statements run by the caller\'s IAM role in the current IAM+-- session are returned. The default is true.+--+-- 'statementName', 'listStatements_statementName' - The name of the SQL statement specified as input to+-- @BatchExecuteStatement@ or @ExecuteStatement@ to identify the query. You+-- can list multiple statements by providing a prefix that matches the+-- beginning of the statement name. For example, to list myStatement1,+-- myStatement2, myStatement3, and so on, then provide the a value of+-- @myStatement@. Data API does a case-sensitive match of SQL statement+-- names to the prefix value you provide.+--+-- 'status', 'listStatements_status' - The status of the SQL statement to list. Status values are defined as+-- follows:+--+-- - ABORTED - The query run was stopped by the user.+--+-- - ALL - A status value that includes all query statuses. This value+-- can be used to filter results.+--+-- - FAILED - The query run failed.+--+-- - FINISHED - The query has finished running.+--+-- - PICKED - The query has been chosen to be run.+--+-- - STARTED - The query run has started.+--+-- - SUBMITTED - The query was submitted, but not yet processed.+newListStatements ::+ ListStatements+newListStatements =+ ListStatements'+ { maxResults = Prelude.Nothing,+ nextToken = Prelude.Nothing,+ roleLevel = Prelude.Nothing,+ statementName = Prelude.Nothing,+ status = Prelude.Nothing+ }++-- | The maximum number of SQL statements to return in the response. If more+-- SQL statements exist than fit in one response, then @NextToken@ is+-- returned to page through the results.+listStatements_maxResults :: Lens.Lens' ListStatements (Prelude.Maybe Prelude.Natural)+listStatements_maxResults = Lens.lens (\ListStatements' {maxResults} -> maxResults) (\s@ListStatements' {} a -> s {maxResults = a} :: ListStatements)++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listStatements_nextToken :: Lens.Lens' ListStatements (Prelude.Maybe Prelude.Text)+listStatements_nextToken = Lens.lens (\ListStatements' {nextToken} -> nextToken) (\s@ListStatements' {} a -> s {nextToken = a} :: ListStatements)++-- | A value that filters which statements to return in the response. If+-- true, all statements run by the caller\'s IAM role are returned. If+-- false, only statements run by the caller\'s IAM role in the current IAM+-- session are returned. The default is true.+listStatements_roleLevel :: Lens.Lens' ListStatements (Prelude.Maybe Prelude.Bool)+listStatements_roleLevel = Lens.lens (\ListStatements' {roleLevel} -> roleLevel) (\s@ListStatements' {} a -> s {roleLevel = a} :: ListStatements)++-- | The name of the SQL statement specified as input to+-- @BatchExecuteStatement@ or @ExecuteStatement@ to identify the query. You+-- can list multiple statements by providing a prefix that matches the+-- beginning of the statement name. For example, to list myStatement1,+-- myStatement2, myStatement3, and so on, then provide the a value of+-- @myStatement@. Data API does a case-sensitive match of SQL statement+-- names to the prefix value you provide.+listStatements_statementName :: Lens.Lens' ListStatements (Prelude.Maybe Prelude.Text)+listStatements_statementName = Lens.lens (\ListStatements' {statementName} -> statementName) (\s@ListStatements' {} a -> s {statementName = a} :: ListStatements)++-- | The status of the SQL statement to list. Status values are defined as+-- follows:+--+-- - ABORTED - The query run was stopped by the user.+--+-- - ALL - A status value that includes all query statuses. This value+-- can be used to filter results.+--+-- - FAILED - The query run failed.+--+-- - FINISHED - The query has finished running.+--+-- - PICKED - The query has been chosen to be run.+--+-- - STARTED - The query run has started.+--+-- - SUBMITTED - The query was submitted, but not yet processed.+listStatements_status :: Lens.Lens' ListStatements (Prelude.Maybe StatusString)+listStatements_status = Lens.lens (\ListStatements' {status} -> status) (\s@ListStatements' {} a -> s {status = a} :: ListStatements)++instance Core.AWSPager ListStatements where+ page rq rs+ | Core.stop+ ( rs+ Lens.^? listStatementsResponse_nextToken+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Core.stop+ (rs Lens.^. listStatementsResponse_statements) =+ Prelude.Nothing+ | Prelude.otherwise =+ Prelude.Just+ Prelude.$ rq+ Prelude.& listStatements_nextToken+ Lens..~ rs+ Lens.^? listStatementsResponse_nextToken+ Prelude.. Lens._Just++instance Core.AWSRequest ListStatements where+ type+ AWSResponse ListStatements =+ ListStatementsResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ ListStatementsResponse'+ Prelude.<$> (x Data..?> "NextToken")+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ Prelude.<*> (x Data..?> "Statements" Core..!@ Prelude.mempty)+ )++instance Prelude.Hashable ListStatements where+ hashWithSalt _salt ListStatements' {..} =+ _salt+ `Prelude.hashWithSalt` maxResults+ `Prelude.hashWithSalt` nextToken+ `Prelude.hashWithSalt` roleLevel+ `Prelude.hashWithSalt` statementName+ `Prelude.hashWithSalt` status++instance Prelude.NFData ListStatements where+ rnf ListStatements' {..} =+ Prelude.rnf maxResults+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf roleLevel+ `Prelude.seq` Prelude.rnf statementName+ `Prelude.seq` Prelude.rnf status++instance Data.ToHeaders ListStatements where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ( "RedshiftData.ListStatements" ::+ Prelude.ByteString+ ),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON ListStatements where+ toJSON ListStatements' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("MaxResults" Data..=) Prelude.<$> maxResults,+ ("NextToken" Data..=) Prelude.<$> nextToken,+ ("RoleLevel" Data..=) Prelude.<$> roleLevel,+ ("StatementName" Data..=) Prelude.<$> statementName,+ ("Status" Data..=) Prelude.<$> status+ ]+ )++instance Data.ToPath ListStatements where+ toPath = Prelude.const "/"++instance Data.ToQuery ListStatements where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newListStatementsResponse' smart constructor.+data ListStatementsResponse = ListStatementsResponse'+ { -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The response's http status code.+ httpStatus :: Prelude.Int,+ -- | The SQL statements.+ statements :: [StatementData]+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListStatementsResponse' 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:+--+-- 'nextToken', 'listStatementsResponse_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'httpStatus', 'listStatementsResponse_httpStatus' - The response's http status code.+--+-- 'statements', 'listStatementsResponse_statements' - The SQL statements.+newListStatementsResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ ListStatementsResponse+newListStatementsResponse pHttpStatus_ =+ ListStatementsResponse'+ { nextToken =+ Prelude.Nothing,+ httpStatus = pHttpStatus_,+ statements = Prelude.mempty+ }++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listStatementsResponse_nextToken :: Lens.Lens' ListStatementsResponse (Prelude.Maybe Prelude.Text)+listStatementsResponse_nextToken = Lens.lens (\ListStatementsResponse' {nextToken} -> nextToken) (\s@ListStatementsResponse' {} a -> s {nextToken = a} :: ListStatementsResponse)++-- | The response's http status code.+listStatementsResponse_httpStatus :: Lens.Lens' ListStatementsResponse Prelude.Int+listStatementsResponse_httpStatus = Lens.lens (\ListStatementsResponse' {httpStatus} -> httpStatus) (\s@ListStatementsResponse' {} a -> s {httpStatus = a} :: ListStatementsResponse)++-- | The SQL statements.+listStatementsResponse_statements :: Lens.Lens' ListStatementsResponse [StatementData]+listStatementsResponse_statements = Lens.lens (\ListStatementsResponse' {statements} -> statements) (\s@ListStatementsResponse' {} a -> s {statements = a} :: ListStatementsResponse) Prelude.. Lens.coerced++instance Prelude.NFData ListStatementsResponse where+ rnf ListStatementsResponse' {..} =+ Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf httpStatus+ `Prelude.seq` Prelude.rnf statements
+ gen/Amazonka/RedshiftData/ListTables.hs view
@@ -0,0 +1,441 @@+{-# 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.RedshiftData.ListTables+-- Copyright : (c) 2013-2023 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- List the tables in a database. If neither @SchemaPattern@ nor+-- @TablePattern@ are specified, then all tables in the database are+-- returned. A token is returned to page through the table list. Depending+-- on the authorization method, use one of the following combinations of+-- request parameters:+--+-- - Secrets Manager - when connecting to a cluster, specify the Amazon+-- Resource Name (ARN) of the secret, the database name, and the+-- cluster identifier that matches the cluster in the secret. When+-- connecting to a serverless workgroup, specify the Amazon Resource+-- Name (ARN) of the secret and the database name.+--+-- - Temporary credentials - when connecting to a cluster, specify the+-- cluster identifier, the database name, and the database user name.+-- Also, permission to call the @redshift:GetClusterCredentials@+-- operation is required. When connecting to a serverless workgroup,+-- specify the workgroup name and database name. Also, permission to+-- call the @redshift-serverless:GetCredentials@ operation is required.+--+-- For more information about the Amazon Redshift Data API and CLI usage+-- examples, see+-- <https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html Using the Amazon Redshift Data API>+-- in the /Amazon Redshift Management Guide/.+--+-- This operation returns paginated results.+module Amazonka.RedshiftData.ListTables+ ( -- * Creating a Request+ ListTables (..),+ newListTables,++ -- * Request Lenses+ listTables_clusterIdentifier,+ listTables_connectedDatabase,+ listTables_dbUser,+ listTables_maxResults,+ listTables_nextToken,+ listTables_schemaPattern,+ listTables_secretArn,+ listTables_tablePattern,+ listTables_workgroupName,+ listTables_database,++ -- * Destructuring the Response+ ListTablesResponse (..),+ newListTablesResponse,++ -- * Response Lenses+ listTablesResponse_nextToken,+ listTablesResponse_tables,+ listTablesResponse_httpStatus,+ )+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+import Amazonka.RedshiftData.Types+import qualified Amazonka.Request as Request+import qualified Amazonka.Response as Response++-- | /See:/ 'newListTables' smart constructor.+data ListTables = ListTables'+ { -- | The cluster identifier. This parameter is required when connecting to a+ -- cluster and authenticating using either Secrets Manager or temporary+ -- credentials.+ clusterIdentifier :: Prelude.Maybe Prelude.Text,+ -- | A database name. The connected database is specified when you connect+ -- with your authentication credentials.+ connectedDatabase :: Prelude.Maybe Prelude.Text,+ -- | The database user name. This parameter is required when connecting to a+ -- cluster and authenticating using temporary credentials.+ dbUser :: Prelude.Maybe Prelude.Text,+ -- | The maximum number of tables to return in the response. If more tables+ -- exist than fit in one response, then @NextToken@ is returned to page+ -- through the results.+ maxResults :: Prelude.Maybe Prelude.Natural,+ -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | A pattern to filter results by schema name. Within a schema pattern,+ -- \"%\" means match any substring of 0 or more characters and \"_\" means+ -- match any one character. Only schema name entries matching the search+ -- pattern are returned. If @SchemaPattern@ is not specified, then all+ -- tables that match @TablePattern@ are returned. If neither+ -- @SchemaPattern@ or @TablePattern@ are specified, then all tables are+ -- returned.+ schemaPattern :: Prelude.Maybe Prelude.Text,+ -- | The name or ARN of the secret that enables access to the database. This+ -- parameter is required when authenticating using Secrets Manager.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | A pattern to filter results by table name. Within a table pattern, \"%\"+ -- means match any substring of 0 or more characters and \"_\" means match+ -- any one character. Only table name entries matching the search pattern+ -- are returned. If @TablePattern@ is not specified, then all tables that+ -- match @SchemaPattern@are returned. If neither @SchemaPattern@ or+ -- @TablePattern@ are specified, then all tables are returned.+ tablePattern :: Prelude.Maybe Prelude.Text,+ -- | The serverless workgroup name. This parameter is required when+ -- connecting to a serverless workgroup and authenticating using either+ -- Secrets Manager or temporary credentials.+ workgroupName :: Prelude.Maybe Prelude.Text,+ -- | The name of the database that contains the tables to list. If+ -- @ConnectedDatabase@ is not specified, this is also the database to+ -- connect to with your authentication credentials.+ database :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListTables' 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:+--+-- 'clusterIdentifier', 'listTables_clusterIdentifier' - The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+--+-- 'connectedDatabase', 'listTables_connectedDatabase' - A database name. The connected database is specified when you connect+-- with your authentication credentials.+--+-- 'dbUser', 'listTables_dbUser' - The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+--+-- 'maxResults', 'listTables_maxResults' - The maximum number of tables to return in the response. If more tables+-- exist than fit in one response, then @NextToken@ is returned to page+-- through the results.+--+-- 'nextToken', 'listTables_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'schemaPattern', 'listTables_schemaPattern' - A pattern to filter results by schema name. Within a schema pattern,+-- \"%\" means match any substring of 0 or more characters and \"_\" means+-- match any one character. Only schema name entries matching the search+-- pattern are returned. If @SchemaPattern@ is not specified, then all+-- tables that match @TablePattern@ are returned. If neither+-- @SchemaPattern@ or @TablePattern@ are specified, then all tables are+-- returned.+--+-- 'secretArn', 'listTables_secretArn' - The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+--+-- 'tablePattern', 'listTables_tablePattern' - A pattern to filter results by table name. Within a table pattern, \"%\"+-- means match any substring of 0 or more characters and \"_\" means match+-- any one character. Only table name entries matching the search pattern+-- are returned. If @TablePattern@ is not specified, then all tables that+-- match @SchemaPattern@are returned. If neither @SchemaPattern@ or+-- @TablePattern@ are specified, then all tables are returned.+--+-- 'workgroupName', 'listTables_workgroupName' - The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+--+-- 'database', 'listTables_database' - The name of the database that contains the tables to list. If+-- @ConnectedDatabase@ is not specified, this is also the database to+-- connect to with your authentication credentials.+newListTables ::+ -- | 'database'+ Prelude.Text ->+ ListTables+newListTables pDatabase_ =+ ListTables'+ { clusterIdentifier = Prelude.Nothing,+ connectedDatabase = Prelude.Nothing,+ dbUser = Prelude.Nothing,+ maxResults = Prelude.Nothing,+ nextToken = Prelude.Nothing,+ schemaPattern = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ tablePattern = Prelude.Nothing,+ workgroupName = Prelude.Nothing,+ database = pDatabase_+ }++-- | The cluster identifier. This parameter is required when connecting to a+-- cluster and authenticating using either Secrets Manager or temporary+-- credentials.+listTables_clusterIdentifier :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_clusterIdentifier = Lens.lens (\ListTables' {clusterIdentifier} -> clusterIdentifier) (\s@ListTables' {} a -> s {clusterIdentifier = a} :: ListTables)++-- | A database name. The connected database is specified when you connect+-- with your authentication credentials.+listTables_connectedDatabase :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_connectedDatabase = Lens.lens (\ListTables' {connectedDatabase} -> connectedDatabase) (\s@ListTables' {} a -> s {connectedDatabase = a} :: ListTables)++-- | The database user name. This parameter is required when connecting to a+-- cluster and authenticating using temporary credentials.+listTables_dbUser :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_dbUser = Lens.lens (\ListTables' {dbUser} -> dbUser) (\s@ListTables' {} a -> s {dbUser = a} :: ListTables)++-- | The maximum number of tables to return in the response. If more tables+-- exist than fit in one response, then @NextToken@ is returned to page+-- through the results.+listTables_maxResults :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Natural)+listTables_maxResults = Lens.lens (\ListTables' {maxResults} -> maxResults) (\s@ListTables' {} a -> s {maxResults = a} :: ListTables)++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listTables_nextToken :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_nextToken = Lens.lens (\ListTables' {nextToken} -> nextToken) (\s@ListTables' {} a -> s {nextToken = a} :: ListTables)++-- | A pattern to filter results by schema name. Within a schema pattern,+-- \"%\" means match any substring of 0 or more characters and \"_\" means+-- match any one character. Only schema name entries matching the search+-- pattern are returned. If @SchemaPattern@ is not specified, then all+-- tables that match @TablePattern@ are returned. If neither+-- @SchemaPattern@ or @TablePattern@ are specified, then all tables are+-- returned.+listTables_schemaPattern :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_schemaPattern = Lens.lens (\ListTables' {schemaPattern} -> schemaPattern) (\s@ListTables' {} a -> s {schemaPattern = a} :: ListTables)++-- | The name or ARN of the secret that enables access to the database. This+-- parameter is required when authenticating using Secrets Manager.+listTables_secretArn :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_secretArn = Lens.lens (\ListTables' {secretArn} -> secretArn) (\s@ListTables' {} a -> s {secretArn = a} :: ListTables)++-- | A pattern to filter results by table name. Within a table pattern, \"%\"+-- means match any substring of 0 or more characters and \"_\" means match+-- any one character. Only table name entries matching the search pattern+-- are returned. If @TablePattern@ is not specified, then all tables that+-- match @SchemaPattern@are returned. If neither @SchemaPattern@ or+-- @TablePattern@ are specified, then all tables are returned.+listTables_tablePattern :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_tablePattern = Lens.lens (\ListTables' {tablePattern} -> tablePattern) (\s@ListTables' {} a -> s {tablePattern = a} :: ListTables)++-- | The serverless workgroup name. This parameter is required when+-- connecting to a serverless workgroup and authenticating using either+-- Secrets Manager or temporary credentials.+listTables_workgroupName :: Lens.Lens' ListTables (Prelude.Maybe Prelude.Text)+listTables_workgroupName = Lens.lens (\ListTables' {workgroupName} -> workgroupName) (\s@ListTables' {} a -> s {workgroupName = a} :: ListTables)++-- | The name of the database that contains the tables to list. If+-- @ConnectedDatabase@ is not specified, this is also the database to+-- connect to with your authentication credentials.+listTables_database :: Lens.Lens' ListTables Prelude.Text+listTables_database = Lens.lens (\ListTables' {database} -> database) (\s@ListTables' {} a -> s {database = a} :: ListTables)++instance Core.AWSPager ListTables where+ page rq rs+ | Core.stop+ ( rs+ Lens.^? listTablesResponse_nextToken+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Core.stop+ ( rs+ Lens.^? listTablesResponse_tables+ Prelude.. Lens._Just+ ) =+ Prelude.Nothing+ | Prelude.otherwise =+ Prelude.Just+ Prelude.$ rq+ Prelude.& listTables_nextToken+ Lens..~ rs+ Lens.^? listTablesResponse_nextToken+ Prelude.. Lens._Just++instance Core.AWSRequest ListTables where+ type AWSResponse ListTables = ListTablesResponse+ request overrides =+ Request.postJSON (overrides defaultService)+ response =+ Response.receiveJSON+ ( \s h x ->+ ListTablesResponse'+ Prelude.<$> (x Data..?> "NextToken")+ Prelude.<*> (x Data..?> "Tables" Core..!@ Prelude.mempty)+ Prelude.<*> (Prelude.pure (Prelude.fromEnum s))+ )++instance Prelude.Hashable ListTables where+ hashWithSalt _salt ListTables' {..} =+ _salt+ `Prelude.hashWithSalt` clusterIdentifier+ `Prelude.hashWithSalt` connectedDatabase+ `Prelude.hashWithSalt` dbUser+ `Prelude.hashWithSalt` maxResults+ `Prelude.hashWithSalt` nextToken+ `Prelude.hashWithSalt` schemaPattern+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` tablePattern+ `Prelude.hashWithSalt` workgroupName+ `Prelude.hashWithSalt` database++instance Prelude.NFData ListTables where+ rnf ListTables' {..} =+ Prelude.rnf clusterIdentifier+ `Prelude.seq` Prelude.rnf connectedDatabase+ `Prelude.seq` Prelude.rnf dbUser+ `Prelude.seq` Prelude.rnf maxResults+ `Prelude.seq` Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf schemaPattern+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf tablePattern+ `Prelude.seq` Prelude.rnf workgroupName+ `Prelude.seq` Prelude.rnf database++instance Data.ToHeaders ListTables where+ toHeaders =+ Prelude.const+ ( Prelude.mconcat+ [ "X-Amz-Target"+ Data.=# ("RedshiftData.ListTables" :: Prelude.ByteString),+ "Content-Type"+ Data.=# ( "application/x-amz-json-1.1" ::+ Prelude.ByteString+ )+ ]+ )++instance Data.ToJSON ListTables where+ toJSON ListTables' {..} =+ Data.object+ ( Prelude.catMaybes+ [ ("ClusterIdentifier" Data..=)+ Prelude.<$> clusterIdentifier,+ ("ConnectedDatabase" Data..=)+ Prelude.<$> connectedDatabase,+ ("DbUser" Data..=) Prelude.<$> dbUser,+ ("MaxResults" Data..=) Prelude.<$> maxResults,+ ("NextToken" Data..=) Prelude.<$> nextToken,+ ("SchemaPattern" Data..=) Prelude.<$> schemaPattern,+ ("SecretArn" Data..=) Prelude.<$> secretArn,+ ("TablePattern" Data..=) Prelude.<$> tablePattern,+ ("WorkgroupName" Data..=) Prelude.<$> workgroupName,+ Prelude.Just ("Database" Data..= database)+ ]+ )++instance Data.ToPath ListTables where+ toPath = Prelude.const "/"++instance Data.ToQuery ListTables where+ toQuery = Prelude.const Prelude.mempty++-- | /See:/ 'newListTablesResponse' smart constructor.+data ListTablesResponse = ListTablesResponse'+ { -- | A value that indicates the starting point for the next set of response+ -- records in a subsequent request. If a value is returned in a response,+ -- you can retrieve the next set of records by providing this returned+ -- NextToken value in the next NextToken parameter and retrying the+ -- command. If the NextToken field is empty, all response records have been+ -- retrieved for the request.+ nextToken :: Prelude.Maybe Prelude.Text,+ -- | The tables that match the request pattern.+ tables :: Prelude.Maybe [TableMember],+ -- | The response's http status code.+ httpStatus :: Prelude.Int+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ListTablesResponse' 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:+--+-- 'nextToken', 'listTablesResponse_nextToken' - A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+--+-- 'tables', 'listTablesResponse_tables' - The tables that match the request pattern.+--+-- 'httpStatus', 'listTablesResponse_httpStatus' - The response's http status code.+newListTablesResponse ::+ -- | 'httpStatus'+ Prelude.Int ->+ ListTablesResponse+newListTablesResponse pHttpStatus_ =+ ListTablesResponse'+ { nextToken = Prelude.Nothing,+ tables = Prelude.Nothing,+ httpStatus = pHttpStatus_+ }++-- | A value that indicates the starting point for the next set of response+-- records in a subsequent request. If a value is returned in a response,+-- you can retrieve the next set of records by providing this returned+-- NextToken value in the next NextToken parameter and retrying the+-- command. If the NextToken field is empty, all response records have been+-- retrieved for the request.+listTablesResponse_nextToken :: Lens.Lens' ListTablesResponse (Prelude.Maybe Prelude.Text)+listTablesResponse_nextToken = Lens.lens (\ListTablesResponse' {nextToken} -> nextToken) (\s@ListTablesResponse' {} a -> s {nextToken = a} :: ListTablesResponse)++-- | The tables that match the request pattern.+listTablesResponse_tables :: Lens.Lens' ListTablesResponse (Prelude.Maybe [TableMember])+listTablesResponse_tables = Lens.lens (\ListTablesResponse' {tables} -> tables) (\s@ListTablesResponse' {} a -> s {tables = a} :: ListTablesResponse) Prelude.. Lens.mapping Lens.coerced++-- | The response's http status code.+listTablesResponse_httpStatus :: Lens.Lens' ListTablesResponse Prelude.Int+listTablesResponse_httpStatus = Lens.lens (\ListTablesResponse' {httpStatus} -> httpStatus) (\s@ListTablesResponse' {} a -> s {httpStatus = a} :: ListTablesResponse)++instance Prelude.NFData ListTablesResponse where+ rnf ListTablesResponse' {..} =+ Prelude.rnf nextToken+ `Prelude.seq` Prelude.rnf tables+ `Prelude.seq` Prelude.rnf httpStatus
+ gen/Amazonka/RedshiftData/Types.hs view
@@ -0,0 +1,236 @@+{-# 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.RedshiftData.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.RedshiftData.Types+ ( -- * Service Configuration+ defaultService,++ -- * Errors+ _ActiveStatementsExceededException,+ _BatchExecuteStatementException,+ _DatabaseConnectionException,+ _ExecuteStatementException,+ _InternalServerException,+ _ResourceNotFoundException,+ _ValidationException,++ -- * StatementStatusString+ StatementStatusString (..),++ -- * StatusString+ StatusString (..),++ -- * ColumnMetadata+ ColumnMetadata (..),+ newColumnMetadata,+ columnMetadata_columnDefault,+ columnMetadata_isCaseSensitive,+ columnMetadata_isCurrency,+ columnMetadata_isSigned,+ columnMetadata_label,+ columnMetadata_length,+ columnMetadata_name,+ columnMetadata_nullable,+ columnMetadata_precision,+ columnMetadata_scale,+ columnMetadata_schemaName,+ columnMetadata_tableName,+ columnMetadata_typeName,++ -- * Field+ Field (..),+ newField,+ field_blobValue,+ field_booleanValue,+ field_doubleValue,+ field_isNull,+ field_longValue,+ field_stringValue,++ -- * SqlParameter+ SqlParameter (..),+ newSqlParameter,+ sqlParameter_name,+ sqlParameter_value,++ -- * StatementData+ StatementData (..),+ newStatementData,+ statementData_createdAt,+ statementData_isBatchStatement,+ statementData_queryParameters,+ statementData_queryString,+ statementData_queryStrings,+ statementData_secretArn,+ statementData_statementName,+ statementData_status,+ statementData_updatedAt,+ statementData_id,++ -- * SubStatementData+ SubStatementData (..),+ newSubStatementData,+ subStatementData_createdAt,+ subStatementData_duration,+ subStatementData_error,+ subStatementData_hasResultSet,+ subStatementData_queryString,+ subStatementData_redshiftQueryId,+ subStatementData_resultRows,+ subStatementData_resultSize,+ subStatementData_status,+ subStatementData_updatedAt,+ subStatementData_id,++ -- * TableMember+ TableMember (..),+ newTableMember,+ tableMember_name,+ tableMember_schema,+ tableMember_type,+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Core.Lens.Internal as Lens+import qualified Amazonka.Prelude as Prelude+import Amazonka.RedshiftData.Types.ColumnMetadata+import Amazonka.RedshiftData.Types.Field+import Amazonka.RedshiftData.Types.SqlParameter+import Amazonka.RedshiftData.Types.StatementData+import Amazonka.RedshiftData.Types.StatementStatusString+import Amazonka.RedshiftData.Types.StatusString+import Amazonka.RedshiftData.Types.SubStatementData+import Amazonka.RedshiftData.Types.TableMember+import qualified Amazonka.Sign.V4 as Sign++-- | API version @2019-12-20@ of the Amazon Redshift Data API Service SDK configuration.+defaultService :: Core.Service+defaultService =+ Core.Service+ { Core.abbrev = "RedshiftData",+ Core.signer = Sign.v4,+ Core.endpointPrefix = "redshift-data",+ Core.signingName = "redshift-data",+ Core.version = "2019-12-20",+ Core.s3AddressingStyle = Core.S3AddressingStyleAuto,+ Core.endpoint = Core.defaultEndpoint defaultService,+ Core.timeout = Prelude.Just 70,+ Core.check = Core.statusSuccess,+ Core.error = Core.parseJSONError "RedshiftData",+ 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 number of active statements exceeds the limit.+_ActiveStatementsExceededException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_ActiveStatementsExceededException =+ Core._MatchServiceError+ defaultService+ "ActiveStatementsExceededException"++-- | An SQL statement encountered an environmental error while running.+_BatchExecuteStatementException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_BatchExecuteStatementException =+ Core._MatchServiceError+ defaultService+ "BatchExecuteStatementException"++-- | Connection to a database failed.+_DatabaseConnectionException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_DatabaseConnectionException =+ Core._MatchServiceError+ defaultService+ "DatabaseConnectionException"++-- | The SQL statement encountered an environmental error while running.+_ExecuteStatementException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_ExecuteStatementException =+ Core._MatchServiceError+ defaultService+ "ExecuteStatementException"++-- | The Amazon Redshift Data API operation failed due to invalid input.+_InternalServerException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_InternalServerException =+ Core._MatchServiceError+ defaultService+ "InternalServerException"++-- | The Amazon Redshift Data API operation failed due to a missing resource.+_ResourceNotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_ResourceNotFoundException =+ Core._MatchServiceError+ defaultService+ "ResourceNotFoundException"++-- | The Amazon Redshift Data API operation failed due to invalid input.+_ValidationException :: (Core.AsError a) => Lens.Fold a Core.ServiceError+_ValidationException =+ Core._MatchServiceError+ defaultService+ "ValidationException"
+ gen/Amazonka/RedshiftData/Types/ColumnMetadata.hs view
@@ -0,0 +1,216 @@+{-# 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.RedshiftData.Types.ColumnMetadata+-- 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.RedshiftData.Types.ColumnMetadata 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++-- | The properties (metadata) of a column.+--+-- /See:/ 'newColumnMetadata' smart constructor.+data ColumnMetadata = ColumnMetadata'+ { -- | The default value of the column.+ columnDefault :: Prelude.Maybe Prelude.Text,+ -- | A value that indicates whether the column is case-sensitive.+ isCaseSensitive :: Prelude.Maybe Prelude.Bool,+ -- | A value that indicates whether the column contains currency values.+ isCurrency :: Prelude.Maybe Prelude.Bool,+ -- | A value that indicates whether an integer column is signed.+ isSigned :: Prelude.Maybe Prelude.Bool,+ -- | The label for the column.+ label :: Prelude.Maybe Prelude.Text,+ -- | The length of the column.+ length :: Prelude.Maybe Prelude.Int,+ -- | The name of the column.+ name :: Prelude.Maybe Prelude.Text,+ -- | A value that indicates whether the column is nullable.+ nullable :: Prelude.Maybe Prelude.Int,+ -- | The precision value of a decimal number column.+ precision :: Prelude.Maybe Prelude.Int,+ -- | The scale value of a decimal number column.+ scale :: Prelude.Maybe Prelude.Int,+ -- | The name of the schema that contains the table that includes the column.+ schemaName :: Prelude.Maybe Prelude.Text,+ -- | The name of the table that includes the column.+ tableName :: Prelude.Maybe Prelude.Text,+ -- | The database-specific data type of the column.+ typeName :: Prelude.Maybe Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'ColumnMetadata' 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:+--+-- 'columnDefault', 'columnMetadata_columnDefault' - The default value of the column.+--+-- 'isCaseSensitive', 'columnMetadata_isCaseSensitive' - A value that indicates whether the column is case-sensitive.+--+-- 'isCurrency', 'columnMetadata_isCurrency' - A value that indicates whether the column contains currency values.+--+-- 'isSigned', 'columnMetadata_isSigned' - A value that indicates whether an integer column is signed.+--+-- 'label', 'columnMetadata_label' - The label for the column.+--+-- 'length', 'columnMetadata_length' - The length of the column.+--+-- 'name', 'columnMetadata_name' - The name of the column.+--+-- 'nullable', 'columnMetadata_nullable' - A value that indicates whether the column is nullable.+--+-- 'precision', 'columnMetadata_precision' - The precision value of a decimal number column.+--+-- 'scale', 'columnMetadata_scale' - The scale value of a decimal number column.+--+-- 'schemaName', 'columnMetadata_schemaName' - The name of the schema that contains the table that includes the column.+--+-- 'tableName', 'columnMetadata_tableName' - The name of the table that includes the column.+--+-- 'typeName', 'columnMetadata_typeName' - The database-specific data type of the column.+newColumnMetadata ::+ ColumnMetadata+newColumnMetadata =+ ColumnMetadata'+ { columnDefault = Prelude.Nothing,+ isCaseSensitive = Prelude.Nothing,+ isCurrency = Prelude.Nothing,+ isSigned = Prelude.Nothing,+ label = Prelude.Nothing,+ length = Prelude.Nothing,+ name = Prelude.Nothing,+ nullable = Prelude.Nothing,+ precision = Prelude.Nothing,+ scale = Prelude.Nothing,+ schemaName = Prelude.Nothing,+ tableName = Prelude.Nothing,+ typeName = Prelude.Nothing+ }++-- | The default value of the column.+columnMetadata_columnDefault :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)+columnMetadata_columnDefault = Lens.lens (\ColumnMetadata' {columnDefault} -> columnDefault) (\s@ColumnMetadata' {} a -> s {columnDefault = a} :: ColumnMetadata)++-- | A value that indicates whether the column is case-sensitive.+columnMetadata_isCaseSensitive :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)+columnMetadata_isCaseSensitive = Lens.lens (\ColumnMetadata' {isCaseSensitive} -> isCaseSensitive) (\s@ColumnMetadata' {} a -> s {isCaseSensitive = a} :: ColumnMetadata)++-- | A value that indicates whether the column contains currency values.+columnMetadata_isCurrency :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)+columnMetadata_isCurrency = Lens.lens (\ColumnMetadata' {isCurrency} -> isCurrency) (\s@ColumnMetadata' {} a -> s {isCurrency = a} :: ColumnMetadata)++-- | A value that indicates whether an integer column is signed.+columnMetadata_isSigned :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Bool)+columnMetadata_isSigned = Lens.lens (\ColumnMetadata' {isSigned} -> isSigned) (\s@ColumnMetadata' {} a -> s {isSigned = a} :: ColumnMetadata)++-- | The label for the column.+columnMetadata_label :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)+columnMetadata_label = Lens.lens (\ColumnMetadata' {label} -> label) (\s@ColumnMetadata' {} a -> s {label = a} :: ColumnMetadata)++-- | The length of the column.+columnMetadata_length :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)+columnMetadata_length = Lens.lens (\ColumnMetadata' {length} -> length) (\s@ColumnMetadata' {} a -> s {length = a} :: ColumnMetadata)++-- | The name of the column.+columnMetadata_name :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)+columnMetadata_name = Lens.lens (\ColumnMetadata' {name} -> name) (\s@ColumnMetadata' {} a -> s {name = a} :: ColumnMetadata)++-- | A value that indicates whether the column is nullable.+columnMetadata_nullable :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)+columnMetadata_nullable = Lens.lens (\ColumnMetadata' {nullable} -> nullable) (\s@ColumnMetadata' {} a -> s {nullable = a} :: ColumnMetadata)++-- | The precision value of a decimal number column.+columnMetadata_precision :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)+columnMetadata_precision = Lens.lens (\ColumnMetadata' {precision} -> precision) (\s@ColumnMetadata' {} a -> s {precision = a} :: ColumnMetadata)++-- | The scale value of a decimal number column.+columnMetadata_scale :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Int)+columnMetadata_scale = Lens.lens (\ColumnMetadata' {scale} -> scale) (\s@ColumnMetadata' {} a -> s {scale = a} :: ColumnMetadata)++-- | The name of the schema that contains the table that includes the column.+columnMetadata_schemaName :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)+columnMetadata_schemaName = Lens.lens (\ColumnMetadata' {schemaName} -> schemaName) (\s@ColumnMetadata' {} a -> s {schemaName = a} :: ColumnMetadata)++-- | The name of the table that includes the column.+columnMetadata_tableName :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)+columnMetadata_tableName = Lens.lens (\ColumnMetadata' {tableName} -> tableName) (\s@ColumnMetadata' {} a -> s {tableName = a} :: ColumnMetadata)++-- | The database-specific data type of the column.+columnMetadata_typeName :: Lens.Lens' ColumnMetadata (Prelude.Maybe Prelude.Text)+columnMetadata_typeName = Lens.lens (\ColumnMetadata' {typeName} -> typeName) (\s@ColumnMetadata' {} a -> s {typeName = a} :: ColumnMetadata)++instance Data.FromJSON ColumnMetadata where+ parseJSON =+ Data.withObject+ "ColumnMetadata"+ ( \x ->+ ColumnMetadata'+ Prelude.<$> (x Data..:? "columnDefault")+ Prelude.<*> (x Data..:? "isCaseSensitive")+ Prelude.<*> (x Data..:? "isCurrency")+ Prelude.<*> (x Data..:? "isSigned")+ Prelude.<*> (x Data..:? "label")+ Prelude.<*> (x Data..:? "length")+ Prelude.<*> (x Data..:? "name")+ Prelude.<*> (x Data..:? "nullable")+ Prelude.<*> (x Data..:? "precision")+ Prelude.<*> (x Data..:? "scale")+ Prelude.<*> (x Data..:? "schemaName")+ Prelude.<*> (x Data..:? "tableName")+ Prelude.<*> (x Data..:? "typeName")+ )++instance Prelude.Hashable ColumnMetadata where+ hashWithSalt _salt ColumnMetadata' {..} =+ _salt+ `Prelude.hashWithSalt` columnDefault+ `Prelude.hashWithSalt` isCaseSensitive+ `Prelude.hashWithSalt` isCurrency+ `Prelude.hashWithSalt` isSigned+ `Prelude.hashWithSalt` label+ `Prelude.hashWithSalt` length+ `Prelude.hashWithSalt` name+ `Prelude.hashWithSalt` nullable+ `Prelude.hashWithSalt` precision+ `Prelude.hashWithSalt` scale+ `Prelude.hashWithSalt` schemaName+ `Prelude.hashWithSalt` tableName+ `Prelude.hashWithSalt` typeName++instance Prelude.NFData ColumnMetadata where+ rnf ColumnMetadata' {..} =+ Prelude.rnf columnDefault+ `Prelude.seq` Prelude.rnf isCaseSensitive+ `Prelude.seq` Prelude.rnf isCurrency+ `Prelude.seq` Prelude.rnf isSigned+ `Prelude.seq` Prelude.rnf label+ `Prelude.seq` Prelude.rnf length+ `Prelude.seq` Prelude.rnf name+ `Prelude.seq` Prelude.rnf nullable+ `Prelude.seq` Prelude.rnf precision+ `Prelude.seq` Prelude.rnf scale+ `Prelude.seq` Prelude.rnf schemaName+ `Prelude.seq` Prelude.rnf tableName+ `Prelude.seq` Prelude.rnf typeName
+ gen/Amazonka/RedshiftData/Types/Field.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.RedshiftData.Types.Field+-- 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.RedshiftData.Types.Field 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++-- | A data value in a column.+--+-- /See:/ 'newField' smart constructor.+data Field = Field'+ { -- | A value of the BLOB data type.+ blobValue :: Prelude.Maybe Data.Base64,+ -- | A value of the Boolean data type.+ booleanValue :: Prelude.Maybe Prelude.Bool,+ -- | A value of the double data type.+ doubleValue :: Prelude.Maybe Prelude.Double,+ -- | A value that indicates whether the data is NULL.+ isNull :: Prelude.Maybe Prelude.Bool,+ -- | A value of the long data type.+ longValue :: Prelude.Maybe Prelude.Integer,+ -- | A value of the string data type.+ stringValue :: Prelude.Maybe Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'Field' 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:+--+-- 'blobValue', 'field_blobValue' - A value of the BLOB data type.--+-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.+-- -- The underlying isomorphism will encode to Base64 representation during+-- -- serialisation, and decode from Base64 representation during deserialisation.+-- -- This 'Lens' accepts and returns only raw unencoded data.+--+-- 'booleanValue', 'field_booleanValue' - A value of the Boolean data type.+--+-- 'doubleValue', 'field_doubleValue' - A value of the double data type.+--+-- 'isNull', 'field_isNull' - A value that indicates whether the data is NULL.+--+-- 'longValue', 'field_longValue' - A value of the long data type.+--+-- 'stringValue', 'field_stringValue' - A value of the string data type.+newField ::+ Field+newField =+ Field'+ { blobValue = Prelude.Nothing,+ booleanValue = Prelude.Nothing,+ doubleValue = Prelude.Nothing,+ isNull = Prelude.Nothing,+ longValue = Prelude.Nothing,+ stringValue = Prelude.Nothing+ }++-- | A value of the BLOB data type.--+-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.+-- -- The underlying isomorphism will encode to Base64 representation during+-- -- serialisation, and decode from Base64 representation during deserialisation.+-- -- This 'Lens' accepts and returns only raw unencoded data.+field_blobValue :: Lens.Lens' Field (Prelude.Maybe Prelude.ByteString)+field_blobValue = Lens.lens (\Field' {blobValue} -> blobValue) (\s@Field' {} a -> s {blobValue = a} :: Field) Prelude.. Lens.mapping Data._Base64++-- | A value of the Boolean data type.+field_booleanValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Bool)+field_booleanValue = Lens.lens (\Field' {booleanValue} -> booleanValue) (\s@Field' {} a -> s {booleanValue = a} :: Field)++-- | A value of the double data type.+field_doubleValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Double)+field_doubleValue = Lens.lens (\Field' {doubleValue} -> doubleValue) (\s@Field' {} a -> s {doubleValue = a} :: Field)++-- | A value that indicates whether the data is NULL.+field_isNull :: Lens.Lens' Field (Prelude.Maybe Prelude.Bool)+field_isNull = Lens.lens (\Field' {isNull} -> isNull) (\s@Field' {} a -> s {isNull = a} :: Field)++-- | A value of the long data type.+field_longValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Integer)+field_longValue = Lens.lens (\Field' {longValue} -> longValue) (\s@Field' {} a -> s {longValue = a} :: Field)++-- | A value of the string data type.+field_stringValue :: Lens.Lens' Field (Prelude.Maybe Prelude.Text)+field_stringValue = Lens.lens (\Field' {stringValue} -> stringValue) (\s@Field' {} a -> s {stringValue = a} :: Field)++instance Data.FromJSON Field where+ parseJSON =+ Data.withObject+ "Field"+ ( \x ->+ Field'+ Prelude.<$> (x Data..:? "blobValue")+ Prelude.<*> (x Data..:? "booleanValue")+ Prelude.<*> (x Data..:? "doubleValue")+ Prelude.<*> (x Data..:? "isNull")+ Prelude.<*> (x Data..:? "longValue")+ Prelude.<*> (x Data..:? "stringValue")+ )++instance Prelude.Hashable Field where+ hashWithSalt _salt Field' {..} =+ _salt+ `Prelude.hashWithSalt` blobValue+ `Prelude.hashWithSalt` booleanValue+ `Prelude.hashWithSalt` doubleValue+ `Prelude.hashWithSalt` isNull+ `Prelude.hashWithSalt` longValue+ `Prelude.hashWithSalt` stringValue++instance Prelude.NFData Field where+ rnf Field' {..} =+ Prelude.rnf blobValue+ `Prelude.seq` Prelude.rnf booleanValue+ `Prelude.seq` Prelude.rnf doubleValue+ `Prelude.seq` Prelude.rnf isNull+ `Prelude.seq` Prelude.rnf longValue+ `Prelude.seq` Prelude.rnf stringValue
+ gen/Amazonka/RedshiftData/Types/SqlParameter.hs view
@@ -0,0 +1,102 @@+{-# 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.RedshiftData.Types.SqlParameter+-- 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.RedshiftData.Types.SqlParameter 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++-- | A parameter used in a SQL statement.+--+-- /See:/ 'newSqlParameter' smart constructor.+data SqlParameter = SqlParameter'+ { -- | The name of the parameter.+ name :: Prelude.Text,+ -- | The value of the parameter. Amazon Redshift implicitly converts to the+ -- proper data type. For more information, see+ -- <https://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html Data types>+ -- in the /Amazon Redshift Database Developer Guide/.+ value :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'SqlParameter' 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', 'sqlParameter_name' - The name of the parameter.+--+-- 'value', 'sqlParameter_value' - The value of the parameter. Amazon Redshift implicitly converts to the+-- proper data type. For more information, see+-- <https://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html Data types>+-- in the /Amazon Redshift Database Developer Guide/.+newSqlParameter ::+ -- | 'name'+ Prelude.Text ->+ -- | 'value'+ Prelude.Text ->+ SqlParameter+newSqlParameter pName_ pValue_ =+ SqlParameter' {name = pName_, value = pValue_}++-- | The name of the parameter.+sqlParameter_name :: Lens.Lens' SqlParameter Prelude.Text+sqlParameter_name = Lens.lens (\SqlParameter' {name} -> name) (\s@SqlParameter' {} a -> s {name = a} :: SqlParameter)++-- | The value of the parameter. Amazon Redshift implicitly converts to the+-- proper data type. For more information, see+-- <https://docs.aws.amazon.com/redshift/latest/dg/c_Supported_data_types.html Data types>+-- in the /Amazon Redshift Database Developer Guide/.+sqlParameter_value :: Lens.Lens' SqlParameter Prelude.Text+sqlParameter_value = Lens.lens (\SqlParameter' {value} -> value) (\s@SqlParameter' {} a -> s {value = a} :: SqlParameter)++instance Data.FromJSON SqlParameter where+ parseJSON =+ Data.withObject+ "SqlParameter"+ ( \x ->+ SqlParameter'+ Prelude.<$> (x Data..: "name")+ Prelude.<*> (x Data..: "value")+ )++instance Prelude.Hashable SqlParameter where+ hashWithSalt _salt SqlParameter' {..} =+ _salt+ `Prelude.hashWithSalt` name+ `Prelude.hashWithSalt` value++instance Prelude.NFData SqlParameter where+ rnf SqlParameter' {..} =+ Prelude.rnf name `Prelude.seq` Prelude.rnf value++instance Data.ToJSON SqlParameter where+ toJSON SqlParameter' {..} =+ Data.object+ ( Prelude.catMaybes+ [ Prelude.Just ("name" Data..= name),+ Prelude.Just ("value" Data..= value)+ ]+ )
+ gen/Amazonka/RedshiftData/Types/StatementData.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.RedshiftData.Types.StatementData+-- 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.RedshiftData.Types.StatementData 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+import Amazonka.RedshiftData.Types.SqlParameter+import Amazonka.RedshiftData.Types.StatusString++-- | The SQL statement to run.+--+-- /See:/ 'newStatementData' smart constructor.+data StatementData = StatementData'+ { -- | The date and time (UTC) the statement was created.+ createdAt :: Prelude.Maybe Data.POSIX,+ -- | A value that indicates whether the statement is a batch query request.+ isBatchStatement :: Prelude.Maybe Prelude.Bool,+ -- | The parameters used in a SQL statement.+ queryParameters :: Prelude.Maybe (Prelude.NonEmpty SqlParameter),+ -- | The SQL statement.+ queryString :: Prelude.Maybe Prelude.Text,+ -- | One or more SQL statements. Each query string in the array corresponds+ -- to one of the queries in a batch query request.+ queryStrings :: Prelude.Maybe [Prelude.Text],+ -- | The name or Amazon Resource Name (ARN) of the secret that enables access+ -- to the database.+ secretArn :: Prelude.Maybe Prelude.Text,+ -- | The name of the SQL statement.+ statementName :: Prelude.Maybe Prelude.Text,+ -- | The status of the SQL statement. An example is the that the SQL+ -- statement finished.+ status :: Prelude.Maybe StatusString,+ -- | The date and time (UTC) that the statement metadata was last updated.+ updatedAt :: Prelude.Maybe Data.POSIX,+ -- | The SQL statement identifier. This value is a universally unique+ -- identifier (UUID) generated by Amazon Redshift Data API.+ id :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'StatementData' 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:+--+-- 'createdAt', 'statementData_createdAt' - The date and time (UTC) the statement was created.+--+-- 'isBatchStatement', 'statementData_isBatchStatement' - A value that indicates whether the statement is a batch query request.+--+-- 'queryParameters', 'statementData_queryParameters' - The parameters used in a SQL statement.+--+-- 'queryString', 'statementData_queryString' - The SQL statement.+--+-- 'queryStrings', 'statementData_queryStrings' - One or more SQL statements. Each query string in the array corresponds+-- to one of the queries in a batch query request.+--+-- 'secretArn', 'statementData_secretArn' - The name or Amazon Resource Name (ARN) of the secret that enables access+-- to the database.+--+-- 'statementName', 'statementData_statementName' - The name of the SQL statement.+--+-- 'status', 'statementData_status' - The status of the SQL statement. An example is the that the SQL+-- statement finished.+--+-- 'updatedAt', 'statementData_updatedAt' - The date and time (UTC) that the statement metadata was last updated.+--+-- 'id', 'statementData_id' - The SQL statement identifier. This value is a universally unique+-- identifier (UUID) generated by Amazon Redshift Data API.+newStatementData ::+ -- | 'id'+ Prelude.Text ->+ StatementData+newStatementData pId_ =+ StatementData'+ { createdAt = Prelude.Nothing,+ isBatchStatement = Prelude.Nothing,+ queryParameters = Prelude.Nothing,+ queryString = Prelude.Nothing,+ queryStrings = Prelude.Nothing,+ secretArn = Prelude.Nothing,+ statementName = Prelude.Nothing,+ status = Prelude.Nothing,+ updatedAt = Prelude.Nothing,+ id = pId_+ }++-- | The date and time (UTC) the statement was created.+statementData_createdAt :: Lens.Lens' StatementData (Prelude.Maybe Prelude.UTCTime)+statementData_createdAt = Lens.lens (\StatementData' {createdAt} -> createdAt) (\s@StatementData' {} a -> s {createdAt = a} :: StatementData) Prelude.. Lens.mapping Data._Time++-- | A value that indicates whether the statement is a batch query request.+statementData_isBatchStatement :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Bool)+statementData_isBatchStatement = Lens.lens (\StatementData' {isBatchStatement} -> isBatchStatement) (\s@StatementData' {} a -> s {isBatchStatement = a} :: StatementData)++-- | The parameters used in a SQL statement.+statementData_queryParameters :: Lens.Lens' StatementData (Prelude.Maybe (Prelude.NonEmpty SqlParameter))+statementData_queryParameters = Lens.lens (\StatementData' {queryParameters} -> queryParameters) (\s@StatementData' {} a -> s {queryParameters = a} :: StatementData) Prelude.. Lens.mapping Lens.coerced++-- | The SQL statement.+statementData_queryString :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Text)+statementData_queryString = Lens.lens (\StatementData' {queryString} -> queryString) (\s@StatementData' {} a -> s {queryString = a} :: StatementData)++-- | One or more SQL statements. Each query string in the array corresponds+-- to one of the queries in a batch query request.+statementData_queryStrings :: Lens.Lens' StatementData (Prelude.Maybe [Prelude.Text])+statementData_queryStrings = Lens.lens (\StatementData' {queryStrings} -> queryStrings) (\s@StatementData' {} a -> s {queryStrings = a} :: StatementData) Prelude.. Lens.mapping Lens.coerced++-- | The name or Amazon Resource Name (ARN) of the secret that enables access+-- to the database.+statementData_secretArn :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Text)+statementData_secretArn = Lens.lens (\StatementData' {secretArn} -> secretArn) (\s@StatementData' {} a -> s {secretArn = a} :: StatementData)++-- | The name of the SQL statement.+statementData_statementName :: Lens.Lens' StatementData (Prelude.Maybe Prelude.Text)+statementData_statementName = Lens.lens (\StatementData' {statementName} -> statementName) (\s@StatementData' {} a -> s {statementName = a} :: StatementData)++-- | The status of the SQL statement. An example is the that the SQL+-- statement finished.+statementData_status :: Lens.Lens' StatementData (Prelude.Maybe StatusString)+statementData_status = Lens.lens (\StatementData' {status} -> status) (\s@StatementData' {} a -> s {status = a} :: StatementData)++-- | The date and time (UTC) that the statement metadata was last updated.+statementData_updatedAt :: Lens.Lens' StatementData (Prelude.Maybe Prelude.UTCTime)+statementData_updatedAt = Lens.lens (\StatementData' {updatedAt} -> updatedAt) (\s@StatementData' {} a -> s {updatedAt = a} :: StatementData) Prelude.. Lens.mapping Data._Time++-- | The SQL statement identifier. This value is a universally unique+-- identifier (UUID) generated by Amazon Redshift Data API.+statementData_id :: Lens.Lens' StatementData Prelude.Text+statementData_id = Lens.lens (\StatementData' {id} -> id) (\s@StatementData' {} a -> s {id = a} :: StatementData)++instance Data.FromJSON StatementData where+ parseJSON =+ Data.withObject+ "StatementData"+ ( \x ->+ StatementData'+ Prelude.<$> (x Data..:? "CreatedAt")+ Prelude.<*> (x Data..:? "IsBatchStatement")+ Prelude.<*> (x Data..:? "QueryParameters")+ Prelude.<*> (x Data..:? "QueryString")+ Prelude.<*> (x Data..:? "QueryStrings" Data..!= Prelude.mempty)+ Prelude.<*> (x Data..:? "SecretArn")+ Prelude.<*> (x Data..:? "StatementName")+ Prelude.<*> (x Data..:? "Status")+ Prelude.<*> (x Data..:? "UpdatedAt")+ Prelude.<*> (x Data..: "Id")+ )++instance Prelude.Hashable StatementData where+ hashWithSalt _salt StatementData' {..} =+ _salt+ `Prelude.hashWithSalt` createdAt+ `Prelude.hashWithSalt` isBatchStatement+ `Prelude.hashWithSalt` queryParameters+ `Prelude.hashWithSalt` queryString+ `Prelude.hashWithSalt` queryStrings+ `Prelude.hashWithSalt` secretArn+ `Prelude.hashWithSalt` statementName+ `Prelude.hashWithSalt` status+ `Prelude.hashWithSalt` updatedAt+ `Prelude.hashWithSalt` id++instance Prelude.NFData StatementData where+ rnf StatementData' {..} =+ Prelude.rnf createdAt+ `Prelude.seq` Prelude.rnf isBatchStatement+ `Prelude.seq` Prelude.rnf queryParameters+ `Prelude.seq` Prelude.rnf queryString+ `Prelude.seq` Prelude.rnf queryStrings+ `Prelude.seq` Prelude.rnf secretArn+ `Prelude.seq` Prelude.rnf statementName+ `Prelude.seq` Prelude.rnf status+ `Prelude.seq` Prelude.rnf updatedAt+ `Prelude.seq` Prelude.rnf id
+ gen/Amazonka/RedshiftData/Types/StatementStatusString.hs view
@@ -0,0 +1,91 @@+{-# 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.RedshiftData.Types.StatementStatusString+-- 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.RedshiftData.Types.StatementStatusString+ ( StatementStatusString+ ( ..,+ StatementStatusString_ABORTED,+ StatementStatusString_FAILED,+ StatementStatusString_FINISHED,+ StatementStatusString_PICKED,+ StatementStatusString_STARTED,+ StatementStatusString_SUBMITTED+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype StatementStatusString = StatementStatusString'+ { fromStatementStatusString ::+ 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 StatementStatusString_ABORTED :: StatementStatusString+pattern StatementStatusString_ABORTED = StatementStatusString' "ABORTED"++pattern StatementStatusString_FAILED :: StatementStatusString+pattern StatementStatusString_FAILED = StatementStatusString' "FAILED"++pattern StatementStatusString_FINISHED :: StatementStatusString+pattern StatementStatusString_FINISHED = StatementStatusString' "FINISHED"++pattern StatementStatusString_PICKED :: StatementStatusString+pattern StatementStatusString_PICKED = StatementStatusString' "PICKED"++pattern StatementStatusString_STARTED :: StatementStatusString+pattern StatementStatusString_STARTED = StatementStatusString' "STARTED"++pattern StatementStatusString_SUBMITTED :: StatementStatusString+pattern StatementStatusString_SUBMITTED = StatementStatusString' "SUBMITTED"++{-# COMPLETE+ StatementStatusString_ABORTED,+ StatementStatusString_FAILED,+ StatementStatusString_FINISHED,+ StatementStatusString_PICKED,+ StatementStatusString_STARTED,+ StatementStatusString_SUBMITTED,+ StatementStatusString'+ #-}
+ gen/Amazonka/RedshiftData/Types/StatusString.hs view
@@ -0,0 +1,96 @@+{-# 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.RedshiftData.Types.StatusString+-- 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.RedshiftData.Types.StatusString+ ( StatusString+ ( ..,+ StatusString_ABORTED,+ StatusString_ALL,+ StatusString_FAILED,+ StatusString_FINISHED,+ StatusString_PICKED,+ StatusString_STARTED,+ StatusString_SUBMITTED+ ),+ )+where++import qualified Amazonka.Core as Core+import qualified Amazonka.Data as Data+import qualified Amazonka.Prelude as Prelude++newtype StatusString = StatusString'+ { fromStatusString ::+ 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 StatusString_ABORTED :: StatusString+pattern StatusString_ABORTED = StatusString' "ABORTED"++pattern StatusString_ALL :: StatusString+pattern StatusString_ALL = StatusString' "ALL"++pattern StatusString_FAILED :: StatusString+pattern StatusString_FAILED = StatusString' "FAILED"++pattern StatusString_FINISHED :: StatusString+pattern StatusString_FINISHED = StatusString' "FINISHED"++pattern StatusString_PICKED :: StatusString+pattern StatusString_PICKED = StatusString' "PICKED"++pattern StatusString_STARTED :: StatusString+pattern StatusString_STARTED = StatusString' "STARTED"++pattern StatusString_SUBMITTED :: StatusString+pattern StatusString_SUBMITTED = StatusString' "SUBMITTED"++{-# COMPLETE+ StatusString_ABORTED,+ StatusString_ALL,+ StatusString_FAILED,+ StatusString_FINISHED,+ StatusString_PICKED,+ StatusString_STARTED,+ StatusString_SUBMITTED,+ StatusString'+ #-}
+ gen/Amazonka/RedshiftData/Types/SubStatementData.hs view
@@ -0,0 +1,231 @@+{-# 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.RedshiftData.Types.SubStatementData+-- 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.RedshiftData.Types.SubStatementData 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+import Amazonka.RedshiftData.Types.StatementStatusString++-- | Information about an SQL statement.+--+-- /See:/ 'newSubStatementData' smart constructor.+data SubStatementData = SubStatementData'+ { -- | The date and time (UTC) the statement was created.+ createdAt :: Prelude.Maybe Data.POSIX,+ -- | The amount of time in nanoseconds that the statement ran.+ duration :: Prelude.Maybe Prelude.Integer,+ -- | The error message from the cluster if the SQL statement encountered an+ -- error while running.+ error :: Prelude.Maybe Prelude.Text,+ -- | A value that indicates whether the statement has a result set. The+ -- result set can be empty. The value is true for an empty result set.+ hasResultSet :: Prelude.Maybe Prelude.Bool,+ -- | The SQL statement text.+ queryString :: Prelude.Maybe Prelude.Text,+ -- | The SQL statement identifier. This value is a universally unique+ -- identifier (UUID) generated by Amazon Redshift Data API.+ redshiftQueryId :: Prelude.Maybe Prelude.Integer,+ -- | Either the number of rows returned from the SQL statement or the number+ -- of rows affected. If result size is greater than zero, the result rows+ -- can be the number of rows affected by SQL statements such as INSERT,+ -- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.+ resultRows :: Prelude.Maybe Prelude.Integer,+ -- | The size in bytes of the returned results. A @-1@ indicates the value is+ -- null.+ resultSize :: Prelude.Maybe Prelude.Integer,+ -- | The status of the SQL statement. An example is the that the SQL+ -- statement finished.+ status :: Prelude.Maybe StatementStatusString,+ -- | The date and time (UTC) that the statement metadata was last updated.+ updatedAt :: Prelude.Maybe Data.POSIX,+ -- | The identifier of the SQL statement. This value is a universally unique+ -- identifier (UUID) generated by Amazon Redshift Data API. A suffix+ -- indicates the number of the SQL statement. For example,+ -- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that+ -- indicates the second SQL statement of a batch query.+ id :: Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'SubStatementData' 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:+--+-- 'createdAt', 'subStatementData_createdAt' - The date and time (UTC) the statement was created.+--+-- 'duration', 'subStatementData_duration' - The amount of time in nanoseconds that the statement ran.+--+-- 'error', 'subStatementData_error' - The error message from the cluster if the SQL statement encountered an+-- error while running.+--+-- 'hasResultSet', 'subStatementData_hasResultSet' - A value that indicates whether the statement has a result set. The+-- result set can be empty. The value is true for an empty result set.+--+-- 'queryString', 'subStatementData_queryString' - The SQL statement text.+--+-- 'redshiftQueryId', 'subStatementData_redshiftQueryId' - The SQL statement identifier. This value is a universally unique+-- identifier (UUID) generated by Amazon Redshift Data API.+--+-- 'resultRows', 'subStatementData_resultRows' - Either the number of rows returned from the SQL statement or the number+-- of rows affected. If result size is greater than zero, the result rows+-- can be the number of rows affected by SQL statements such as INSERT,+-- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.+--+-- 'resultSize', 'subStatementData_resultSize' - The size in bytes of the returned results. A @-1@ indicates the value is+-- null.+--+-- 'status', 'subStatementData_status' - The status of the SQL statement. An example is the that the SQL+-- statement finished.+--+-- 'updatedAt', 'subStatementData_updatedAt' - The date and time (UTC) that the statement metadata was last updated.+--+-- 'id', 'subStatementData_id' - The identifier of the SQL statement. This value is a universally unique+-- identifier (UUID) generated by Amazon Redshift Data API. A suffix+-- indicates the number of the SQL statement. For example,+-- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that+-- indicates the second SQL statement of a batch query.+newSubStatementData ::+ -- | 'id'+ Prelude.Text ->+ SubStatementData+newSubStatementData pId_ =+ SubStatementData'+ { createdAt = Prelude.Nothing,+ duration = Prelude.Nothing,+ error = Prelude.Nothing,+ hasResultSet = Prelude.Nothing,+ queryString = Prelude.Nothing,+ redshiftQueryId = Prelude.Nothing,+ resultRows = Prelude.Nothing,+ resultSize = Prelude.Nothing,+ status = Prelude.Nothing,+ updatedAt = Prelude.Nothing,+ id = pId_+ }++-- | The date and time (UTC) the statement was created.+subStatementData_createdAt :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.UTCTime)+subStatementData_createdAt = Lens.lens (\SubStatementData' {createdAt} -> createdAt) (\s@SubStatementData' {} a -> s {createdAt = a} :: SubStatementData) Prelude.. Lens.mapping Data._Time++-- | The amount of time in nanoseconds that the statement ran.+subStatementData_duration :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)+subStatementData_duration = Lens.lens (\SubStatementData' {duration} -> duration) (\s@SubStatementData' {} a -> s {duration = a} :: SubStatementData)++-- | The error message from the cluster if the SQL statement encountered an+-- error while running.+subStatementData_error :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Text)+subStatementData_error = Lens.lens (\SubStatementData' {error} -> error) (\s@SubStatementData' {} a -> s {error = a} :: SubStatementData)++-- | A value that indicates whether the statement has a result set. The+-- result set can be empty. The value is true for an empty result set.+subStatementData_hasResultSet :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Bool)+subStatementData_hasResultSet = Lens.lens (\SubStatementData' {hasResultSet} -> hasResultSet) (\s@SubStatementData' {} a -> s {hasResultSet = a} :: SubStatementData)++-- | The SQL statement text.+subStatementData_queryString :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Text)+subStatementData_queryString = Lens.lens (\SubStatementData' {queryString} -> queryString) (\s@SubStatementData' {} a -> s {queryString = a} :: SubStatementData)++-- | The SQL statement identifier. This value is a universally unique+-- identifier (UUID) generated by Amazon Redshift Data API.+subStatementData_redshiftQueryId :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)+subStatementData_redshiftQueryId = Lens.lens (\SubStatementData' {redshiftQueryId} -> redshiftQueryId) (\s@SubStatementData' {} a -> s {redshiftQueryId = a} :: SubStatementData)++-- | Either the number of rows returned from the SQL statement or the number+-- of rows affected. If result size is greater than zero, the result rows+-- can be the number of rows affected by SQL statements such as INSERT,+-- UPDATE, DELETE, COPY, and others. A @-1@ indicates the value is null.+subStatementData_resultRows :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)+subStatementData_resultRows = Lens.lens (\SubStatementData' {resultRows} -> resultRows) (\s@SubStatementData' {} a -> s {resultRows = a} :: SubStatementData)++-- | The size in bytes of the returned results. A @-1@ indicates the value is+-- null.+subStatementData_resultSize :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.Integer)+subStatementData_resultSize = Lens.lens (\SubStatementData' {resultSize} -> resultSize) (\s@SubStatementData' {} a -> s {resultSize = a} :: SubStatementData)++-- | The status of the SQL statement. An example is the that the SQL+-- statement finished.+subStatementData_status :: Lens.Lens' SubStatementData (Prelude.Maybe StatementStatusString)+subStatementData_status = Lens.lens (\SubStatementData' {status} -> status) (\s@SubStatementData' {} a -> s {status = a} :: SubStatementData)++-- | The date and time (UTC) that the statement metadata was last updated.+subStatementData_updatedAt :: Lens.Lens' SubStatementData (Prelude.Maybe Prelude.UTCTime)+subStatementData_updatedAt = Lens.lens (\SubStatementData' {updatedAt} -> updatedAt) (\s@SubStatementData' {} a -> s {updatedAt = a} :: SubStatementData) Prelude.. Lens.mapping Data._Time++-- | The identifier of the SQL statement. This value is a universally unique+-- identifier (UUID) generated by Amazon Redshift Data API. A suffix+-- indicates the number of the SQL statement. For example,+-- @d9b6c0c9-0747-4bf4-b142-e8883122f766:2@ has a suffix of @:2@ that+-- indicates the second SQL statement of a batch query.+subStatementData_id :: Lens.Lens' SubStatementData Prelude.Text+subStatementData_id = Lens.lens (\SubStatementData' {id} -> id) (\s@SubStatementData' {} a -> s {id = a} :: SubStatementData)++instance Data.FromJSON SubStatementData where+ parseJSON =+ Data.withObject+ "SubStatementData"+ ( \x ->+ SubStatementData'+ Prelude.<$> (x Data..:? "CreatedAt")+ Prelude.<*> (x Data..:? "Duration")+ Prelude.<*> (x Data..:? "Error")+ Prelude.<*> (x Data..:? "HasResultSet")+ Prelude.<*> (x Data..:? "QueryString")+ Prelude.<*> (x Data..:? "RedshiftQueryId")+ Prelude.<*> (x Data..:? "ResultRows")+ Prelude.<*> (x Data..:? "ResultSize")+ Prelude.<*> (x Data..:? "Status")+ Prelude.<*> (x Data..:? "UpdatedAt")+ Prelude.<*> (x Data..: "Id")+ )++instance Prelude.Hashable SubStatementData where+ hashWithSalt _salt SubStatementData' {..} =+ _salt+ `Prelude.hashWithSalt` createdAt+ `Prelude.hashWithSalt` duration+ `Prelude.hashWithSalt` error+ `Prelude.hashWithSalt` hasResultSet+ `Prelude.hashWithSalt` queryString+ `Prelude.hashWithSalt` redshiftQueryId+ `Prelude.hashWithSalt` resultRows+ `Prelude.hashWithSalt` resultSize+ `Prelude.hashWithSalt` status+ `Prelude.hashWithSalt` updatedAt+ `Prelude.hashWithSalt` id++instance Prelude.NFData SubStatementData where+ rnf SubStatementData' {..} =+ Prelude.rnf createdAt+ `Prelude.seq` Prelude.rnf duration+ `Prelude.seq` Prelude.rnf error+ `Prelude.seq` Prelude.rnf hasResultSet+ `Prelude.seq` Prelude.rnf queryString+ `Prelude.seq` Prelude.rnf redshiftQueryId+ `Prelude.seq` Prelude.rnf resultRows+ `Prelude.seq` Prelude.rnf resultSize+ `Prelude.seq` Prelude.rnf status+ `Prelude.seq` Prelude.rnf updatedAt+ `Prelude.seq` Prelude.rnf id
+ gen/Amazonka/RedshiftData/Types/TableMember.hs view
@@ -0,0 +1,99 @@+{-# 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.RedshiftData.Types.TableMember+-- 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.RedshiftData.Types.TableMember 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++-- | The properties of a table.+--+-- /See:/ 'newTableMember' smart constructor.+data TableMember = TableMember'+ { -- | The name of the table.+ name :: Prelude.Maybe Prelude.Text,+ -- | The schema containing the table.+ schema :: Prelude.Maybe Prelude.Text,+ -- | The type of the table. Possible values include TABLE, VIEW, SYSTEM+ -- TABLE, GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS, and SYNONYM.+ type' :: Prelude.Maybe Prelude.Text+ }+ deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)++-- |+-- Create a value of 'TableMember' 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', 'tableMember_name' - The name of the table.+--+-- 'schema', 'tableMember_schema' - The schema containing the table.+--+-- 'type'', 'tableMember_type' - The type of the table. Possible values include TABLE, VIEW, SYSTEM+-- TABLE, GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS, and SYNONYM.+newTableMember ::+ TableMember+newTableMember =+ TableMember'+ { name = Prelude.Nothing,+ schema = Prelude.Nothing,+ type' = Prelude.Nothing+ }++-- | The name of the table.+tableMember_name :: Lens.Lens' TableMember (Prelude.Maybe Prelude.Text)+tableMember_name = Lens.lens (\TableMember' {name} -> name) (\s@TableMember' {} a -> s {name = a} :: TableMember)++-- | The schema containing the table.+tableMember_schema :: Lens.Lens' TableMember (Prelude.Maybe Prelude.Text)+tableMember_schema = Lens.lens (\TableMember' {schema} -> schema) (\s@TableMember' {} a -> s {schema = a} :: TableMember)++-- | The type of the table. Possible values include TABLE, VIEW, SYSTEM+-- TABLE, GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS, and SYNONYM.+tableMember_type :: Lens.Lens' TableMember (Prelude.Maybe Prelude.Text)+tableMember_type = Lens.lens (\TableMember' {type'} -> type') (\s@TableMember' {} a -> s {type' = a} :: TableMember)++instance Data.FromJSON TableMember where+ parseJSON =+ Data.withObject+ "TableMember"+ ( \x ->+ TableMember'+ Prelude.<$> (x Data..:? "name")+ Prelude.<*> (x Data..:? "schema")+ Prelude.<*> (x Data..:? "type")+ )++instance Prelude.Hashable TableMember where+ hashWithSalt _salt TableMember' {..} =+ _salt+ `Prelude.hashWithSalt` name+ `Prelude.hashWithSalt` schema+ `Prelude.hashWithSalt` type'++instance Prelude.NFData TableMember where+ rnf TableMember' {..} =+ Prelude.rnf name+ `Prelude.seq` Prelude.rnf schema+ `Prelude.seq` Prelude.rnf type'
+ gen/Amazonka/RedshiftData/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.RedshiftData.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.RedshiftData.Waiters 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+import Amazonka.RedshiftData.Lens+import Amazonka.RedshiftData.Types
+ 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.RedshiftData+import Test.Amazonka.RedshiftData.Internal+import Test.Tasty++main :: IO ()+main =+ defaultMain $+ testGroup+ "RedshiftData"+ [ testGroup "tests" tests,+ testGroup "fixtures" fixtures+ ]
+ test/Test/Amazonka/Gen/RedshiftData.hs view
@@ -0,0 +1,238 @@+{-# 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.RedshiftData+-- 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.RedshiftData where++import Amazonka.RedshiftData+import qualified Data.Proxy as Proxy+import Test.Amazonka.Fixture+import Test.Amazonka.Prelude+import Test.Amazonka.RedshiftData.Internal+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"+-- [ requestBatchExecuteStatement $+-- newBatchExecuteStatement+--+-- , requestCancelStatement $+-- newCancelStatement+--+-- , requestDescribeStatement $+-- newDescribeStatement+--+-- , requestDescribeTable $+-- newDescribeTable+--+-- , requestExecuteStatement $+-- newExecuteStatement+--+-- , requestGetStatementResult $+-- newGetStatementResult+--+-- , requestListDatabases $+-- newListDatabases+--+-- , requestListSchemas $+-- newListSchemas+--+-- , requestListStatements $+-- newListStatements+--+-- , requestListTables $+-- newListTables+--+-- ]++-- , testGroup "response"+-- [ responseBatchExecuteStatement $+-- newBatchExecuteStatementResponse+--+-- , responseCancelStatement $+-- newCancelStatementResponse+--+-- , responseDescribeStatement $+-- newDescribeStatementResponse+--+-- , responseDescribeTable $+-- newDescribeTableResponse+--+-- , responseExecuteStatement $+-- newExecuteStatementResponse+--+-- , responseGetStatementResult $+-- newGetStatementResultResponse+--+-- , responseListDatabases $+-- newListDatabasesResponse+--+-- , responseListSchemas $+-- newListSchemasResponse+--+-- , responseListStatements $+-- newListStatementsResponse+--+-- , responseListTables $+-- newListTablesResponse+--+-- ]+-- ]++-- Requests++requestBatchExecuteStatement :: BatchExecuteStatement -> TestTree+requestBatchExecuteStatement =+ req+ "BatchExecuteStatement"+ "fixture/BatchExecuteStatement.yaml"++requestCancelStatement :: CancelStatement -> TestTree+requestCancelStatement =+ req+ "CancelStatement"+ "fixture/CancelStatement.yaml"++requestDescribeStatement :: DescribeStatement -> TestTree+requestDescribeStatement =+ req+ "DescribeStatement"+ "fixture/DescribeStatement.yaml"++requestDescribeTable :: DescribeTable -> TestTree+requestDescribeTable =+ req+ "DescribeTable"+ "fixture/DescribeTable.yaml"++requestExecuteStatement :: ExecuteStatement -> TestTree+requestExecuteStatement =+ req+ "ExecuteStatement"+ "fixture/ExecuteStatement.yaml"++requestGetStatementResult :: GetStatementResult -> TestTree+requestGetStatementResult =+ req+ "GetStatementResult"+ "fixture/GetStatementResult.yaml"++requestListDatabases :: ListDatabases -> TestTree+requestListDatabases =+ req+ "ListDatabases"+ "fixture/ListDatabases.yaml"++requestListSchemas :: ListSchemas -> TestTree+requestListSchemas =+ req+ "ListSchemas"+ "fixture/ListSchemas.yaml"++requestListStatements :: ListStatements -> TestTree+requestListStatements =+ req+ "ListStatements"+ "fixture/ListStatements.yaml"++requestListTables :: ListTables -> TestTree+requestListTables =+ req+ "ListTables"+ "fixture/ListTables.yaml"++-- Responses++responseBatchExecuteStatement :: BatchExecuteStatementResponse -> TestTree+responseBatchExecuteStatement =+ res+ "BatchExecuteStatementResponse"+ "fixture/BatchExecuteStatementResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy BatchExecuteStatement)++responseCancelStatement :: CancelStatementResponse -> TestTree+responseCancelStatement =+ res+ "CancelStatementResponse"+ "fixture/CancelStatementResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy CancelStatement)++responseDescribeStatement :: DescribeStatementResponse -> TestTree+responseDescribeStatement =+ res+ "DescribeStatementResponse"+ "fixture/DescribeStatementResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy DescribeStatement)++responseDescribeTable :: DescribeTableResponse -> TestTree+responseDescribeTable =+ res+ "DescribeTableResponse"+ "fixture/DescribeTableResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy DescribeTable)++responseExecuteStatement :: ExecuteStatementResponse -> TestTree+responseExecuteStatement =+ res+ "ExecuteStatementResponse"+ "fixture/ExecuteStatementResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy ExecuteStatement)++responseGetStatementResult :: GetStatementResultResponse -> TestTree+responseGetStatementResult =+ res+ "GetStatementResultResponse"+ "fixture/GetStatementResultResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy GetStatementResult)++responseListDatabases :: ListDatabasesResponse -> TestTree+responseListDatabases =+ res+ "ListDatabasesResponse"+ "fixture/ListDatabasesResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy ListDatabases)++responseListSchemas :: ListSchemasResponse -> TestTree+responseListSchemas =+ res+ "ListSchemasResponse"+ "fixture/ListSchemasResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy ListSchemas)++responseListStatements :: ListStatementsResponse -> TestTree+responseListStatements =+ res+ "ListStatementsResponse"+ "fixture/ListStatementsResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy ListStatements)++responseListTables :: ListTablesResponse -> TestTree+responseListTables =+ res+ "ListTablesResponse"+ "fixture/ListTablesResponse.proto"+ defaultService+ (Proxy.Proxy :: Proxy.Proxy ListTables)
+ test/Test/Amazonka/RedshiftData.hs view
@@ -0,0 +1,20 @@+-- |+-- Module : Test.Amazonka.RedshiftData+-- 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.RedshiftData+ ( tests,+ fixtures,+ )+where++import Test.Tasty (TestTree)++tests :: [TestTree]+tests = []++fixtures :: [TestTree]+fixtures = []
+ test/Test/Amazonka/RedshiftData/Internal.hs view
@@ -0,0 +1,8 @@+-- |+-- Module : Test.Amazonka.RedshiftData.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.RedshiftData.Internal where