This commit is contained in:
Javier Casares 2025-11-26 13:39:30 +00:00
commit 27aae99d99
2996 changed files with 130406 additions and 0 deletions

View file

@ -0,0 +1,4 @@
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.

View file

@ -0,0 +1,4 @@
## Building and enabling the Common Run Time
1. **Follow instructions on crt repo** Clone and build the repo as shown [here][https://github.com/awslabs/aws-crt-php].
1. **Enable the CRT** add the following line to your php.ini file `extension=path/to/aws-crt-php/modules/awscrt.so`

141
vendor/aws/aws-sdk-php/LICENSE vendored Normal file
View file

@ -0,0 +1,141 @@
# Apache License
Version 2.0, January 2004
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
## 1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1
through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the
License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled
by, or are under common control with that entity. For the purposes of this definition, "control" means
(i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract
or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software
source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form,
including but not limited to compiled object code, generated documentation, and conversions to other media
types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License,
as indicated by a copyright notice that is included in or attached to the work (an example is provided in the
Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from)
the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent,
as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not
include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work
and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any
modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to
Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to
submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of
electronic, verbal, or written communication sent to the Licensor or its representatives, including but not
limited to communication on electronic mailing lists, source code control systems, and issue tracking systems
that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been
received by Licensor and subsequently incorporated within the Work.
## 2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare
Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
## 3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent
license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such
license applies only to those patent claims licensable by such Contributor that are necessarily infringed by
their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such
Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim
or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work
constitutes direct or contributory patent infringement, then any patent licenses granted to You under this
License for that Work shall terminate as of the date such litigation is filed.
## 4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You meet the following conditions:
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent,
trademark, and attribution notices from the Source form of the Work, excluding those notices that do
not pertain to any part of the Derivative Works; and
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that
You distribute must include a readable copy of the attribution notices contained within such NOTICE
file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed as part of the Derivative Works; within
the Source form or documentation, if provided along with the Derivative Works; or, within a display
generated by the Derivative Works, if and wherever such third-party notices normally appear. The
contents of the NOTICE file are for informational purposes only and do not modify the License. You may
add Your own attribution notices within Derivative Works that You distribute, alongside or as an
addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be
construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license
terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative
Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the
conditions stated in this License.
## 5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by
You to the Licensor shall be under the terms and conditions of this License, without any additional terms or
conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate
license agreement you may have executed with Licensor regarding such Contributions.
## 6. Trademarks.
This License does not grant permission to use the trade names, trademarks, service marks, or product names of
the Licensor, except as required for reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
## 7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor
provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
## 8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless
required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any
Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential
damages of any character arising as a result of this License or out of the use or inability to use the Work
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has been advised of the possibility
of such damages.
## 9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for,
acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole
responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold
each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

17
vendor/aws/aws-sdk-php/NOTICE vendored Normal file
View file

@ -0,0 +1,17 @@
# AWS SDK for PHP
<http://aws.amazon.com/php>
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,84 @@
The AWS SDK for PHP includes the following third-party software/licensing:
** Guzzle - https://github.com/guzzle/guzzle
Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
----------------
** jmespath.php - https://github.com/mtdowling/jmespath.php
Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
----------------
** phpunit-mock-objects -- https://github.com/sebastianbergmann/phpunit-mock-objects
Copyright (c) 2002-2018, Sebastian Bergmann <sebastian@phpunit.de>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Sebastian Bergmann nor the names of his
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

73
vendor/aws/aws-sdk-php/composer.json vendored Normal file
View file

@ -0,0 +1,73 @@
{
"name": "aws/aws-sdk-php",
"homepage": "http://aws.amazon.com/sdkforphp",
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
"keywords": ["aws","amazon","sdk","s3","ec2","dynamodb","cloud","glacier"],
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "Amazon Web Services",
"homepage": "http://aws.amazon.com"
}
],
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues"
},
"require": {
"php": ">=8.1",
"guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.4.5",
"guzzlehttp/promises": "^2.0",
"mtdowling/jmespath.php": "^2.8.0",
"ext-pcre": "*",
"ext-json": "*",
"ext-simplexml": "*",
"aws/aws-crt-php": "^1.2.3",
"psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer" : "^2.7.8",
"ext-openssl": "*",
"ext-dom": "*",
"ext-pcntl": "*",
"ext-sockets": "*",
"phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5",
"behat/behat": "~3.0",
"doctrine/cache": "~1.4",
"aws/aws-php-sns-message-validator": "~1.0",
"andrewsville/php-token-reflection": "^1.4",
"psr/cache": "^2.0 || ^3.0",
"psr/simple-cache": "^2.0 || ^3.0",
"sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
"symfony/filesystem": "^v6.4.0 || ^v7.1.0",
"yoast/phpunit-polyfills": "^2.0",
"dms/phpunit-arraysubset-asserts": "^0.4.0"
},
"suggest": {
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
"ext-curl": "To send requests using cURL",
"ext-sockets": "To use client-side monitoring",
"doctrine/cache": "To use the DoctrineCacheAdapter",
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications"
},
"autoload": {
"psr-4": {
"Aws\\": "src/"
},
"files": ["src/functions.php"],
"exclude-from-classmap": ["src/data/"]
},
"autoload-dev": {
"psr-4": {
"Aws\\Test\\": "tests/"
},
"classmap": ["build/"]
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
}
}

View file

@ -0,0 +1,55 @@
<?php
namespace Aws\ACMPCA;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Certificate Manager Private Certificate Authority** service.
* @method \Aws\Result createCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result createCertificateAuthorityAuditReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise createCertificateAuthorityAuditReportAsync(array $args = [])
* @method \Aws\Result createPermission(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPermissionAsync(array $args = [])
* @method \Aws\Result deleteCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result deletePermission(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePermissionAsync(array $args = [])
* @method \Aws\Result deletePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePolicyAsync(array $args = [])
* @method \Aws\Result describeCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result describeCertificateAuthorityAuditReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCertificateAuthorityAuditReportAsync(array $args = [])
* @method \Aws\Result getCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCertificateAsync(array $args = [])
* @method \Aws\Result getCertificateAuthorityCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCertificateAuthorityCertificateAsync(array $args = [])
* @method \Aws\Result getCertificateAuthorityCsr(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCertificateAuthorityCsrAsync(array $args = [])
* @method \Aws\Result getPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPolicyAsync(array $args = [])
* @method \Aws\Result importCertificateAuthorityCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise importCertificateAuthorityCertificateAsync(array $args = [])
* @method \Aws\Result issueCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise issueCertificateAsync(array $args = [])
* @method \Aws\Result listCertificateAuthorities(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCertificateAuthoritiesAsync(array $args = [])
* @method \Aws\Result listPermissions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPermissionsAsync(array $args = [])
* @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result putPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putPolicyAsync(array $args = [])
* @method \Aws\Result restoreCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise restoreCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result revokeCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise revokeCertificateAsync(array $args = [])
* @method \Aws\Result tagCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result untagCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagCertificateAuthorityAsync(array $args = [])
* @method \Aws\Result updateCertificateAuthority(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateCertificateAuthorityAsync(array $args = [])
*/
class ACMPCAClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ACMPCA\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Certificate Manager Private Certificate Authority** service.
*/
class ACMPCAException extends AwsException {}

View file

@ -0,0 +1,31 @@
<?php
namespace Aws\AIOps;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS AI Ops** service.
* @method \Aws\Result createInvestigationGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createInvestigationGroupAsync(array $args = [])
* @method \Aws\Result deleteInvestigationGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteInvestigationGroupAsync(array $args = [])
* @method \Aws\Result deleteInvestigationGroupPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteInvestigationGroupPolicyAsync(array $args = [])
* @method \Aws\Result getInvestigationGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getInvestigationGroupAsync(array $args = [])
* @method \Aws\Result getInvestigationGroupPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getInvestigationGroupPolicyAsync(array $args = [])
* @method \Aws\Result listInvestigationGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listInvestigationGroupsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putInvestigationGroupPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putInvestigationGroupPolicyAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateInvestigationGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateInvestigationGroupAsync(array $args = [])
*/
class AIOpsClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AIOps\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS AI Ops** service.
*/
class AIOpsException extends AwsException {}

View file

@ -0,0 +1,49 @@
<?php
namespace Aws\ARCRegionSwitch;
use Aws\AwsClient;
/**
* This client is used to interact with the **ARC - Region switch** service.
* @method \Aws\Result approvePlanExecutionStep(array $args = [])
* @method \GuzzleHttp\Promise\Promise approvePlanExecutionStepAsync(array $args = [])
* @method \Aws\Result cancelPlanExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelPlanExecutionAsync(array $args = [])
* @method \Aws\Result createPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPlanAsync(array $args = [])
* @method \Aws\Result deletePlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePlanAsync(array $args = [])
* @method \Aws\Result getPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPlanAsync(array $args = [])
* @method \Aws\Result getPlanEvaluationStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPlanEvaluationStatusAsync(array $args = [])
* @method \Aws\Result getPlanExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPlanExecutionAsync(array $args = [])
* @method \Aws\Result getPlanInRegion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPlanInRegionAsync(array $args = [])
* @method \Aws\Result listPlanExecutionEvents(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPlanExecutionEventsAsync(array $args = [])
* @method \Aws\Result listPlanExecutions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPlanExecutionsAsync(array $args = [])
* @method \Aws\Result listPlans(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPlansAsync(array $args = [])
* @method \Aws\Result listPlansInRegion(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPlansInRegionAsync(array $args = [])
* @method \Aws\Result listRoute53HealthChecks(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRoute53HealthChecksAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startPlanExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise startPlanExecutionAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updatePlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePlanAsync(array $args = [])
* @method \Aws\Result updatePlanExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePlanExecutionAsync(array $args = [])
* @method \Aws\Result updatePlanExecutionStep(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePlanExecutionStepAsync(array $args = [])
*/
class ARCRegionSwitchClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ARCRegionSwitch\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **ARC - Region switch** service.
*/
class ARCRegionSwitchException extends AwsException {}

View file

@ -0,0 +1,39 @@
<?php
namespace Aws\ARCZonalShift;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS ARC - Zonal Shift** service.
* @method \Aws\Result cancelPracticeRun(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelPracticeRunAsync(array $args = [])
* @method \Aws\Result cancelZonalShift(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelZonalShiftAsync(array $args = [])
* @method \Aws\Result createPracticeRunConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPracticeRunConfigurationAsync(array $args = [])
* @method \Aws\Result deletePracticeRunConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePracticeRunConfigurationAsync(array $args = [])
* @method \Aws\Result getAutoshiftObserverNotificationStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAutoshiftObserverNotificationStatusAsync(array $args = [])
* @method \Aws\Result getManagedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getManagedResourceAsync(array $args = [])
* @method \Aws\Result listAutoshifts(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAutoshiftsAsync(array $args = [])
* @method \Aws\Result listManagedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listManagedResourcesAsync(array $args = [])
* @method \Aws\Result listZonalShifts(array $args = [])
* @method \GuzzleHttp\Promise\Promise listZonalShiftsAsync(array $args = [])
* @method \Aws\Result startPracticeRun(array $args = [])
* @method \GuzzleHttp\Promise\Promise startPracticeRunAsync(array $args = [])
* @method \Aws\Result startZonalShift(array $args = [])
* @method \GuzzleHttp\Promise\Promise startZonalShiftAsync(array $args = [])
* @method \Aws\Result updateAutoshiftObserverNotificationStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAutoshiftObserverNotificationStatusAsync(array $args = [])
* @method \Aws\Result updatePracticeRunConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePracticeRunConfigurationAsync(array $args = [])
* @method \Aws\Result updateZonalAutoshiftConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateZonalAutoshiftConfigurationAsync(array $args = [])
* @method \Aws\Result updateZonalShift(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateZonalShiftAsync(array $args = [])
*/
class ARCZonalShiftClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ARCZonalShift\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS ARC - Zonal Shift** service.
*/
class ARCZonalShiftException extends AwsException {}

View file

@ -0,0 +1,157 @@
<?php
namespace Aws;
use GuzzleHttp\Promise;
/**
* A configuration provider is a function that returns a promise that is
* fulfilled with a configuration object. This class provides base functionality
* usable by specific configuration provider implementations
*/
abstract class AbstractConfigurationProvider
{
const ENV_PROFILE = 'AWS_PROFILE';
const ENV_CONFIG_FILE = 'AWS_CONFIG_FILE';
public static $cacheKey;
protected static $interfaceClass;
protected static $exceptionClass;
/**
* Wraps a config provider and saves provided configuration in an
* instance of Aws\CacheInterface. Forwards calls when no config found
* in cache and updates cache with the results.
*
* @param callable $provider Configuration provider function to wrap
* @param CacheInterface $cache Cache to store configuration
* @param string|null $cacheKey (optional) Cache key to use
*
* @return callable
*/
public static function cache(
callable $provider,
CacheInterface $cache,
$cacheKey = null
) {
$cacheKey = $cacheKey ?: static::$cacheKey;
return function () use ($provider, $cache, $cacheKey) {
$found = $cache->get($cacheKey);
if ($found instanceof static::$interfaceClass) {
return Promise\Create::promiseFor($found);
}
return $provider()
->then(function ($config) use (
$cache,
$cacheKey
) {
$cache->set($cacheKey, $config);
return $config;
});
};
}
/**
* Creates an aggregate configuration provider that invokes the provided
* variadic providers one after the other until a provider returns
* configuration.
*
* @return callable
*/
public static function chain()
{
$links = func_get_args();
if (empty($links)) {
throw new \InvalidArgumentException('No providers in chain');
}
return function () use ($links) {
/** @var callable $parent */
$parent = array_shift($links);
$promise = $parent();
while ($next = array_shift($links)) {
$promise = $promise->otherwise($next);
}
return $promise;
};
}
/**
* Gets the environment's HOME directory if available.
*
* @return null|string
*/
protected static function getHomeDir()
{
// On Linux/Unix-like systems, use the HOME environment variable
if ($homeDir = getenv('HOME')) {
return $homeDir;
}
// Get the HOMEDRIVE and HOMEPATH values for Windows hosts
$homeDrive = getenv('HOMEDRIVE');
$homePath = getenv('HOMEPATH');
return ($homeDrive && $homePath) ? $homeDrive . $homePath : null;
}
/**
* Gets default config file location from environment, falling back to aws
* default location
*
* @return string
*/
protected static function getDefaultConfigFilename()
{
if ($filename = getenv(self::ENV_CONFIG_FILE)) {
return $filename;
}
return self::getHomeDir() . '/.aws/config';
}
/**
* Wraps a config provider and caches previously provided configuration.
*
* @param callable $provider Config provider function to wrap.
*
* @return callable
*/
public static function memoize(callable $provider)
{
return function () use ($provider) {
static $result;
static $isConstant;
// Constant config will be returned constantly.
if ($isConstant) {
return $result;
}
// Create the initial promise that will be used as the cached value
if (null === $result) {
$result = $provider();
}
// Return config and set flag that provider is already set
return $result
->then(function ($config) use (&$isConstant) {
$isConstant = true;
return $config;
});
};
}
/**
* Reject promise with standardized exception.
*
* @param $msg
* @return Promise\RejectedPromise
*/
protected static function reject($msg)
{
$exceptionClass = static::$exceptionClass;
return new Promise\RejectedPromise(new $exceptionClass($msg));
}
}

View file

@ -0,0 +1,83 @@
<?php
namespace Aws\AccessAnalyzer;
use Aws\AwsClient;
/**
* This client is used to interact with the **Access Analyzer** service.
* @method \Aws\Result applyArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise applyArchiveRuleAsync(array $args = [])
* @method \Aws\Result cancelPolicyGeneration(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelPolicyGenerationAsync(array $args = [])
* @method \Aws\Result checkAccessNotGranted(array $args = [])
* @method \GuzzleHttp\Promise\Promise checkAccessNotGrantedAsync(array $args = [])
* @method \Aws\Result checkNoNewAccess(array $args = [])
* @method \GuzzleHttp\Promise\Promise checkNoNewAccessAsync(array $args = [])
* @method \Aws\Result checkNoPublicAccess(array $args = [])
* @method \GuzzleHttp\Promise\Promise checkNoPublicAccessAsync(array $args = [])
* @method \Aws\Result createAccessPreview(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAccessPreviewAsync(array $args = [])
* @method \Aws\Result createAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAnalyzerAsync(array $args = [])
* @method \Aws\Result createArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise createArchiveRuleAsync(array $args = [])
* @method \Aws\Result deleteAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAnalyzerAsync(array $args = [])
* @method \Aws\Result deleteArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteArchiveRuleAsync(array $args = [])
* @method \Aws\Result generateFindingRecommendation(array $args = [])
* @method \GuzzleHttp\Promise\Promise generateFindingRecommendationAsync(array $args = [])
* @method \Aws\Result getAccessPreview(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccessPreviewAsync(array $args = [])
* @method \Aws\Result getAnalyzedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAnalyzedResourceAsync(array $args = [])
* @method \Aws\Result getAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAnalyzerAsync(array $args = [])
* @method \Aws\Result getArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise getArchiveRuleAsync(array $args = [])
* @method \Aws\Result getFinding(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingAsync(array $args = [])
* @method \Aws\Result getFindingRecommendation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingRecommendationAsync(array $args = [])
* @method \Aws\Result getFindingV2(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingV2Async(array $args = [])
* @method \Aws\Result getFindingsStatistics(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFindingsStatisticsAsync(array $args = [])
* @method \Aws\Result getGeneratedPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGeneratedPolicyAsync(array $args = [])
* @method \Aws\Result listAccessPreviewFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAccessPreviewFindingsAsync(array $args = [])
* @method \Aws\Result listAccessPreviews(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAccessPreviewsAsync(array $args = [])
* @method \Aws\Result listAnalyzedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAnalyzedResourcesAsync(array $args = [])
* @method \Aws\Result listAnalyzers(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAnalyzersAsync(array $args = [])
* @method \Aws\Result listArchiveRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise listArchiveRulesAsync(array $args = [])
* @method \Aws\Result listFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFindingsAsync(array $args = [])
* @method \Aws\Result listFindingsV2(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFindingsV2Async(array $args = [])
* @method \Aws\Result listPolicyGenerations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPolicyGenerationsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startPolicyGeneration(array $args = [])
* @method \GuzzleHttp\Promise\Promise startPolicyGenerationAsync(array $args = [])
* @method \Aws\Result startResourceScan(array $args = [])
* @method \GuzzleHttp\Promise\Promise startResourceScanAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAnalyzer(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAnalyzerAsync(array $args = [])
* @method \Aws\Result updateArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateArchiveRuleAsync(array $args = [])
* @method \Aws\Result updateFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFindingsAsync(array $args = [])
* @method \Aws\Result validatePolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise validatePolicyAsync(array $args = [])
*/
class AccessAnalyzerClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AccessAnalyzer\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Access Analyzer** service.
*/
class AccessAnalyzerException extends AwsException {}

View file

@ -0,0 +1,37 @@
<?php
namespace Aws\Account;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Account** service.
* @method \Aws\Result acceptPrimaryEmailUpdate(array $args = [])
* @method \GuzzleHttp\Promise\Promise acceptPrimaryEmailUpdateAsync(array $args = [])
* @method \Aws\Result deleteAlternateContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAlternateContactAsync(array $args = [])
* @method \Aws\Result disableRegion(array $args = [])
* @method \GuzzleHttp\Promise\Promise disableRegionAsync(array $args = [])
* @method \Aws\Result enableRegion(array $args = [])
* @method \GuzzleHttp\Promise\Promise enableRegionAsync(array $args = [])
* @method \Aws\Result getAccountInformation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountInformationAsync(array $args = [])
* @method \Aws\Result getAlternateContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAlternateContactAsync(array $args = [])
* @method \Aws\Result getContactInformation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getContactInformationAsync(array $args = [])
* @method \Aws\Result getPrimaryEmail(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPrimaryEmailAsync(array $args = [])
* @method \Aws\Result getRegionOptStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRegionOptStatusAsync(array $args = [])
* @method \Aws\Result listRegions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRegionsAsync(array $args = [])
* @method \Aws\Result putAccountName(array $args = [])
* @method \GuzzleHttp\Promise\Promise putAccountNameAsync(array $args = [])
* @method \Aws\Result putAlternateContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise putAlternateContactAsync(array $args = [])
* @method \Aws\Result putContactInformation(array $args = [])
* @method \GuzzleHttp\Promise\Promise putContactInformationAsync(array $args = [])
* @method \Aws\Result startPrimaryEmailUpdate(array $args = [])
* @method \GuzzleHttp\Promise\Promise startPrimaryEmailUpdateAsync(array $args = [])
*/
class AccountClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\Account\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Account** service.
*/
class AccountException extends AwsException {}

View file

@ -0,0 +1,42 @@
<?php
namespace Aws\Acm;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Certificate Manager** service.
*
* @method \Aws\Result addTagsToCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise addTagsToCertificateAsync(array $args = [])
* @method \Aws\Result deleteCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCertificateAsync(array $args = [])
* @method \Aws\Result describeCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCertificateAsync(array $args = [])
* @method \Aws\Result exportCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportCertificateAsync(array $args = [])
* @method \Aws\Result getAccountConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountConfigurationAsync(array $args = [])
* @method \Aws\Result getCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCertificateAsync(array $args = [])
* @method \Aws\Result importCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise importCertificateAsync(array $args = [])
* @method \Aws\Result listCertificates(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCertificatesAsync(array $args = [])
* @method \Aws\Result listTagsForCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForCertificateAsync(array $args = [])
* @method \Aws\Result putAccountConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putAccountConfigurationAsync(array $args = [])
* @method \Aws\Result removeTagsFromCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeTagsFromCertificateAsync(array $args = [])
* @method \Aws\Result renewCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise renewCertificateAsync(array $args = [])
* @method \Aws\Result requestCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise requestCertificateAsync(array $args = [])
* @method \Aws\Result resendValidationEmail(array $args = [])
* @method \GuzzleHttp\Promise\Promise resendValidationEmailAsync(array $args = [])
* @method \Aws\Result revokeCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise revokeCertificateAsync(array $args = [])
* @method \Aws\Result updateCertificateOptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateCertificateOptionsAsync(array $args = [])
*/
class AcmClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\Acm\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Certificate Manager** service.
*/
class AcmException extends AwsException {}

View file

@ -0,0 +1,83 @@
<?php
namespace Aws\Amplify;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Amplify** service.
* @method \Aws\Result createApp(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppAsync(array $args = [])
* @method \Aws\Result createBackendEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackendEnvironmentAsync(array $args = [])
* @method \Aws\Result createBranch(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBranchAsync(array $args = [])
* @method \Aws\Result createDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDeploymentAsync(array $args = [])
* @method \Aws\Result createDomainAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDomainAssociationAsync(array $args = [])
* @method \Aws\Result createWebhook(array $args = [])
* @method \GuzzleHttp\Promise\Promise createWebhookAsync(array $args = [])
* @method \Aws\Result deleteApp(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppAsync(array $args = [])
* @method \Aws\Result deleteBackendEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackendEnvironmentAsync(array $args = [])
* @method \Aws\Result deleteBranch(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBranchAsync(array $args = [])
* @method \Aws\Result deleteDomainAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDomainAssociationAsync(array $args = [])
* @method \Aws\Result deleteJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteJobAsync(array $args = [])
* @method \Aws\Result deleteWebhook(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteWebhookAsync(array $args = [])
* @method \Aws\Result generateAccessLogs(array $args = [])
* @method \GuzzleHttp\Promise\Promise generateAccessLogsAsync(array $args = [])
* @method \Aws\Result getApp(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAppAsync(array $args = [])
* @method \Aws\Result getArtifactUrl(array $args = [])
* @method \GuzzleHttp\Promise\Promise getArtifactUrlAsync(array $args = [])
* @method \Aws\Result getBackendEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendEnvironmentAsync(array $args = [])
* @method \Aws\Result getBranch(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBranchAsync(array $args = [])
* @method \Aws\Result getDomainAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainAssociationAsync(array $args = [])
* @method \Aws\Result getJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getJobAsync(array $args = [])
* @method \Aws\Result getWebhook(array $args = [])
* @method \GuzzleHttp\Promise\Promise getWebhookAsync(array $args = [])
* @method \Aws\Result listApps(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAppsAsync(array $args = [])
* @method \Aws\Result listArtifacts(array $args = [])
* @method \GuzzleHttp\Promise\Promise listArtifactsAsync(array $args = [])
* @method \Aws\Result listBackendEnvironments(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackendEnvironmentsAsync(array $args = [])
* @method \Aws\Result listBranches(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBranchesAsync(array $args = [])
* @method \Aws\Result listDomainAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDomainAssociationsAsync(array $args = [])
* @method \Aws\Result listJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listJobsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listWebhooks(array $args = [])
* @method \GuzzleHttp\Promise\Promise listWebhooksAsync(array $args = [])
* @method \Aws\Result startDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDeploymentAsync(array $args = [])
* @method \Aws\Result startJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startJobAsync(array $args = [])
* @method \Aws\Result stopJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopJobAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateApp(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAppAsync(array $args = [])
* @method \Aws\Result updateBranch(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBranchAsync(array $args = [])
* @method \Aws\Result updateDomainAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDomainAssociationAsync(array $args = [])
* @method \Aws\Result updateWebhook(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateWebhookAsync(array $args = [])
*/
class AmplifyClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\Amplify\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Amplify** service.
*/
class AmplifyException extends AwsException {}

View file

@ -0,0 +1,71 @@
<?php
namespace Aws\AmplifyBackend;
use Aws\AwsClient;
/**
* This client is used to interact with the **AmplifyBackend** service.
* @method \Aws\Result cloneBackend(array $args = [])
* @method \GuzzleHttp\Promise\Promise cloneBackendAsync(array $args = [])
* @method \Aws\Result createBackend(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackendAsync(array $args = [])
* @method \Aws\Result createBackendAPI(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackendAPIAsync(array $args = [])
* @method \Aws\Result createBackendAuth(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackendAuthAsync(array $args = [])
* @method \Aws\Result createBackendConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackendConfigAsync(array $args = [])
* @method \Aws\Result createBackendStorage(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackendStorageAsync(array $args = [])
* @method \Aws\Result createToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise createTokenAsync(array $args = [])
* @method \Aws\Result deleteBackend(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackendAsync(array $args = [])
* @method \Aws\Result deleteBackendAPI(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackendAPIAsync(array $args = [])
* @method \Aws\Result deleteBackendAuth(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackendAuthAsync(array $args = [])
* @method \Aws\Result deleteBackendStorage(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackendStorageAsync(array $args = [])
* @method \Aws\Result deleteToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTokenAsync(array $args = [])
* @method \Aws\Result generateBackendAPIModels(array $args = [])
* @method \GuzzleHttp\Promise\Promise generateBackendAPIModelsAsync(array $args = [])
* @method \Aws\Result getBackend(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendAsync(array $args = [])
* @method \Aws\Result getBackendAPI(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendAPIAsync(array $args = [])
* @method \Aws\Result getBackendAPIModels(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendAPIModelsAsync(array $args = [])
* @method \Aws\Result getBackendAuth(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendAuthAsync(array $args = [])
* @method \Aws\Result getBackendJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendJobAsync(array $args = [])
* @method \Aws\Result getBackendStorage(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackendStorageAsync(array $args = [])
* @method \Aws\Result getToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTokenAsync(array $args = [])
* @method \Aws\Result importBackendAuth(array $args = [])
* @method \GuzzleHttp\Promise\Promise importBackendAuthAsync(array $args = [])
* @method \Aws\Result importBackendStorage(array $args = [])
* @method \GuzzleHttp\Promise\Promise importBackendStorageAsync(array $args = [])
* @method \Aws\Result listBackendJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackendJobsAsync(array $args = [])
* @method \Aws\Result listS3Buckets(array $args = [])
* @method \GuzzleHttp\Promise\Promise listS3BucketsAsync(array $args = [])
* @method \Aws\Result removeAllBackends(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeAllBackendsAsync(array $args = [])
* @method \Aws\Result removeBackendConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeBackendConfigAsync(array $args = [])
* @method \Aws\Result updateBackendAPI(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBackendAPIAsync(array $args = [])
* @method \Aws\Result updateBackendAuth(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBackendAuthAsync(array $args = [])
* @method \Aws\Result updateBackendConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBackendConfigAsync(array $args = [])
* @method \Aws\Result updateBackendJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBackendJobAsync(array $args = [])
* @method \Aws\Result updateBackendStorage(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBackendStorageAsync(array $args = [])
*/
class AmplifyBackendClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AmplifyBackend\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AmplifyBackend** service.
*/
class AmplifyBackendException extends AwsException {}

View file

@ -0,0 +1,65 @@
<?php
namespace Aws\AmplifyUIBuilder;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Amplify UI Builder** service.
* @method \Aws\Result createComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise createComponentAsync(array $args = [])
* @method \Aws\Result createForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise createFormAsync(array $args = [])
* @method \Aws\Result createTheme(array $args = [])
* @method \GuzzleHttp\Promise\Promise createThemeAsync(array $args = [])
* @method \Aws\Result deleteComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteComponentAsync(array $args = [])
* @method \Aws\Result deleteForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteFormAsync(array $args = [])
* @method \Aws\Result deleteTheme(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteThemeAsync(array $args = [])
* @method \Aws\Result exchangeCodeForToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise exchangeCodeForTokenAsync(array $args = [])
* @method \Aws\Result exportComponents(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportComponentsAsync(array $args = [])
* @method \Aws\Result exportForms(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportFormsAsync(array $args = [])
* @method \Aws\Result exportThemes(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportThemesAsync(array $args = [])
* @method \Aws\Result getCodegenJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCodegenJobAsync(array $args = [])
* @method \Aws\Result getComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise getComponentAsync(array $args = [])
* @method \Aws\Result getForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFormAsync(array $args = [])
* @method \Aws\Result getMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMetadataAsync(array $args = [])
* @method \Aws\Result getTheme(array $args = [])
* @method \GuzzleHttp\Promise\Promise getThemeAsync(array $args = [])
* @method \Aws\Result listCodegenJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCodegenJobsAsync(array $args = [])
* @method \Aws\Result listComponents(array $args = [])
* @method \GuzzleHttp\Promise\Promise listComponentsAsync(array $args = [])
* @method \Aws\Result listForms(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFormsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listThemes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listThemesAsync(array $args = [])
* @method \Aws\Result putMetadataFlag(array $args = [])
* @method \GuzzleHttp\Promise\Promise putMetadataFlagAsync(array $args = [])
* @method \Aws\Result refreshToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise refreshTokenAsync(array $args = [])
* @method \Aws\Result startCodegenJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startCodegenJobAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateComponentAsync(array $args = [])
* @method \Aws\Result updateForm(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFormAsync(array $args = [])
* @method \Aws\Result updateTheme(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateThemeAsync(array $args = [])
*/
class AmplifyUIBuilderClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AmplifyUIBuilder\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Amplify UI Builder** service.
*/
class AmplifyUIBuilderException extends AwsException {}

View file

@ -0,0 +1,89 @@
<?php
namespace Aws\Api;
/**
* Base class that is used by most API shapes
*/
abstract class AbstractModel implements \ArrayAccess
{
/** @var array */
protected $definition;
/** @var ShapeMap */
protected $shapeMap;
/** @var array */
protected $contextParam;
/**
* @param array $definition Service description
* @param ShapeMap $shapeMap Shapemap used for creating shapes
*/
public function __construct(array $definition, ShapeMap $shapeMap)
{
$this->definition = $definition;
$this->shapeMap = $shapeMap;
if (isset($definition['contextParam'])) {
$this->contextParam = $definition['contextParam'];
}
}
public function toArray()
{
return $this->definition;
}
/**
* @return mixed|null
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->definition[$offset])
? $this->definition[$offset] : null;
}
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->definition[$offset] = $value;
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->definition[$offset]);
}
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->definition[$offset]);
}
protected function shapeAt($key)
{
if (!isset($this->definition[$key])) {
throw new \InvalidArgumentException('Expected shape definition at '
. $key);
}
return $this->shapeFor($this->definition[$key]);
}
protected function shapeFor(array $definition)
{
return isset($definition['shape'])
? $this->shapeMap->resolve($definition)
: Shape::create($definition, $this->shapeMap);
}
}

View file

@ -0,0 +1,244 @@
<?php
namespace Aws\Api;
use Aws\Exception\UnresolvedApiException;
/**
* API providers.
*
* An API provider is a function that accepts a type, service, and version and
* returns an array of API data on success or NULL if no API data can be created
* for the provided arguments.
*
* You can wrap your calls to an API provider with the
* {@see ApiProvider::resolve} method to ensure that API data is created. If the
* API data is not created, then the resolve() method will throw a
* {@see Aws\Exception\UnresolvedApiException}.
*
* use Aws\Api\ApiProvider;
* $provider = ApiProvider::defaultProvider();
* // Returns an array or NULL.
* $data = $provider('api', 's3', '2006-03-01');
* // Returns an array or throws.
* $data = ApiProvider::resolve($provider, 'api', 'elasticfood', '2020-01-01');
*
* You can compose multiple providers into a single provider using
* {@see Aws\or_chain}. This method accepts providers as arguments and
* returns a new function that will invoke each provider until a non-null value
* is returned.
*
* $a = ApiProvider::filesystem(sys_get_temp_dir() . '/aws-beta-models');
* $b = ApiProvider::manifest();
*
* $c = \Aws\or_chain($a, $b);
* $data = $c('api', 'betaservice', '2015-08-08'); // $a handles this.
* $data = $c('api', 's3', '2006-03-01'); // $b handles this.
* $data = $c('api', 'invalid', '2014-12-15'); // Neither handles this.
*/
class ApiProvider
{
/** @var array A map of public API type names to their file suffix. */
private static $typeMap = [
'api' => 'api-2',
'paginator' => 'paginators-1',
'waiter' => 'waiters-2',
'docs' => 'docs-2',
];
/** @var array API manifest */
private $manifest;
/** @var string The directory containing service models. */
private $modelsDir;
/**
* Resolves an API provider and ensures a non-null return value.
*
* @param callable $provider Provider function to invoke.
* @param string $type Type of data ('api', 'waiter', 'paginator').
* @param string $service Service name.
* @param string $version API version.
*
* @return array
* @throws UnresolvedApiException
*/
public static function resolve(callable $provider, $type, $service, $version)
{
// Execute the provider and return the result, if there is one.
$result = $provider($type, $service, $version);
if (is_array($result)) {
if (!isset($result['metadata']['serviceIdentifier'])) {
$result['metadata']['serviceIdentifier'] = $service;
}
return $result;
}
// Throw an exception with a message depending on the inputs.
if (!isset(self::$typeMap[$type])) {
$msg = "The type must be one of: " . implode(', ', self::$typeMap);
} elseif ($service) {
$msg = "The {$service} service does not have version: {$version}.";
} else {
$msg = "You must specify a service name to retrieve its API data.";
}
throw new UnresolvedApiException($msg);
}
/**
* Default SDK API provider.
*
* This provider loads pre-built manifest data from the `data` directory.
*
* @return self
*/
public static function defaultProvider()
{
return new self(__DIR__ . '/../data', \Aws\manifest());
}
/**
* Loads API data after resolving the version to the latest, compatible,
* available version based on the provided manifest data.
*
* Manifest data is essentially an associative array of service names to
* associative arrays of API version aliases.
*
* [
* ...
* 'ec2' => [
* 'latest' => '2014-10-01',
* '2014-10-01' => '2014-10-01',
* '2014-09-01' => '2014-10-01',
* '2014-06-15' => '2014-10-01',
* ...
* ],
* 'ecs' => [...],
* 'elasticache' => [...],
* ...
* ]
*
* @param string $dir Directory containing service models.
* @param array $manifest The API version manifest data.
*
* @return self
*/
public static function manifest($dir, array $manifest)
{
return new self($dir, $manifest);
}
/**
* Loads API data from the specified directory.
*
* If "latest" is specified as the version, this provider must glob the
* directory to find which is the latest available version.
*
* @param string $dir Directory containing service models.
*
* @return self
* @throws \InvalidArgumentException if the provided `$dir` is invalid.
*/
public static function filesystem($dir)
{
return new self($dir);
}
/**
* Retrieves a list of valid versions for the specified service.
*
* @param string $service Service name
*
* @return array
*/
public function getVersions($service)
{
if (!isset($this->manifest)) {
$this->buildVersionsList($service);
}
if (!isset($this->manifest[$service]['versions'])) {
return [];
}
return array_values(array_unique($this->manifest[$service]['versions']));
}
/**
* Execute the provider.
*
* @param string $type Type of data ('api', 'waiter', 'paginator').
* @param string $service Service name.
* @param string $version API version.
*
* @return array|null
*/
public function __invoke($type, $service, $version)
{
// Resolve the type or return null.
if (isset(self::$typeMap[$type])) {
$type = self::$typeMap[$type];
} else {
return null;
}
// Resolve the version or return null.
if (!isset($this->manifest)) {
$this->buildVersionsList($service);
}
if (!isset($this->manifest[$service]['versions'][$version])) {
return null;
}
$version = $this->manifest[$service]['versions'][$version];
$path = "{$this->modelsDir}/{$service}/{$version}/{$type}.json";
try {
return \Aws\load_compiled_json($path);
} catch (\InvalidArgumentException $e) {
return null;
}
}
/**
* @param string $modelsDir Directory containing service models.
* @param array $manifest The API version manifest data.
*/
private function __construct($modelsDir, ?array $manifest = null)
{
$this->manifest = $manifest;
$this->modelsDir = rtrim($modelsDir, '/');
if (!is_dir($this->modelsDir)) {
throw new \InvalidArgumentException(
"The specified models directory, {$modelsDir}, was not found."
);
}
}
/**
* Build the versions list for the specified service by globbing the dir.
*/
private function buildVersionsList($service)
{
$dir = "{$this->modelsDir}/{$service}/";
if (!is_dir($dir)) {
return;
}
// Get versions, remove . and .., and sort in descending order.
$results = array_diff(scandir($dir, SCANDIR_SORT_DESCENDING), ['..', '.']);
if (!$results) {
$this->manifest[$service] = ['versions' => []];
} else {
$this->manifest[$service] = [
'versions' => [
'latest' => $results[0]
]
];
$this->manifest[$service]['versions'] += array_combine($results, $results);
}
}
}

View file

@ -0,0 +1,134 @@
<?php
namespace Aws\Api;
use Aws\Api\Parser\Exception\ParserException;
use DateTime;
use DateTimeZone;
use Exception;
/**
* DateTime overrides that make DateTime work more seamlessly as a string,
* with JSON documents, and with JMESPath.
*/
class DateTimeResult extends \DateTime implements \JsonSerializable
{
private const ISO8601_NANOSECOND_REGEX = '/^(.*\.\d{6})(\d{1,3})(Z|[+-]\d{2}:\d{2})?$/';
/**
* Create a new DateTimeResult from a unix timestamp.
* The Unix epoch (or Unix time or POSIX time or Unix
* timestamp) is the number of seconds that have elapsed since
* January 1, 1970 (midnight UTC/GMT).
*
* @return DateTimeResult
* @throws Exception
*/
public static function fromEpoch($unixTimestamp)
{
if (!is_numeric($unixTimestamp)) {
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromEpoch');
}
// PHP 5.5 does not support sub-second precision
if (\PHP_VERSION_ID < 56000) {
return new self(gmdate('c', $unixTimestamp));
}
$decimalSeparator = isset(localeconv()['decimal_point']) ? localeconv()['decimal_point'] : ".";
$formatString = "U" . $decimalSeparator . "u";
$dateTime = DateTime::createFromFormat(
$formatString,
sprintf('%0.6f', $unixTimestamp),
new DateTimeZone('UTC')
);
if (false === $dateTime) {
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromEpoch');
}
return new self(
$dateTime->format('Y-m-d H:i:s.u'),
new DateTimeZone('UTC')
);
}
/**
* @return DateTimeResult
*/
public static function fromISO8601($iso8601Timestamp)
{
if (is_numeric($iso8601Timestamp) || !is_string($iso8601Timestamp)) {
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromISO8601');
}
// Prior to 8.0.10, nanosecond precision is not supported
// Reduces to microsecond precision if nanosecond precision is detected
if (PHP_VERSION_ID < 80010
&& preg_match(self::ISO8601_NANOSECOND_REGEX, $iso8601Timestamp, $matches)
) {
$iso8601Timestamp = $matches[1] . ($matches[3] ?? '');
}
return new DateTimeResult($iso8601Timestamp);
}
/**
* Create a new DateTimeResult from an unknown timestamp.
*
* @return DateTimeResult
* @throws Exception
*/
public static function fromTimestamp($timestamp, $expectedFormat = null)
{
if (empty($timestamp)) {
return self::fromEpoch(0);
}
if (!(is_string($timestamp) || is_numeric($timestamp))) {
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromTimestamp');
}
try {
if ($expectedFormat == 'iso8601') {
try {
return self::fromISO8601($timestamp);
} catch (Exception $exception) {
return self::fromEpoch($timestamp);
}
} else if ($expectedFormat == 'unixTimestamp') {
try {
return self::fromEpoch($timestamp);
} catch (Exception $exception) {
return self::fromISO8601($timestamp);
}
} else if (\Aws\is_valid_epoch($timestamp)) {
return self::fromEpoch($timestamp);
}
return self::fromISO8601($timestamp);
} catch (Exception $exception) {
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromTimestamp');
}
}
/**
* Serialize the DateTimeResult as an ISO 8601 date string.
*
* @return string
*/
public function __toString()
{
return $this->format('c');
}
/**
* Serialize the date as an ISO 8601 date when serializing as JSON.
*
* @return string
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return (string) $this;
}
}

View file

@ -0,0 +1,139 @@
<?php
namespace Aws\Api;
/**
* Encapsulates the documentation strings for a given service-version and
* provides methods for extracting the desired parts related to a service,
* operation, error, or shape (i.e., parameter).
*/
class DocModel
{
/** @var array */
private $docs;
/**
* @param array $docs
*
* @throws \RuntimeException
*/
public function __construct(array $docs)
{
if (!extension_loaded('tidy')) {
throw new \RuntimeException('The "tidy" PHP extension is required.');
}
$this->docs = $docs;
}
/**
* Convert the doc model to an array.
*
* @return array
*/
public function toArray()
{
return $this->docs;
}
/**
* Retrieves documentation about the service.
*
* @return null|string
*/
public function getServiceDocs()
{
return isset($this->docs['service']) ? $this->docs['service'] : null;
}
/**
* Retrieves documentation about an operation.
*
* @param string $operation Name of the operation
*
* @return null|string
*/
public function getOperationDocs($operation)
{
return isset($this->docs['operations'][$operation])
? $this->docs['operations'][$operation]
: null;
}
/**
* Retrieves documentation about an error.
*
* @param string $error Name of the error
*
* @return null|string
*/
public function getErrorDocs($error)
{
return isset($this->docs['shapes'][$error]['base'])
? $this->docs['shapes'][$error]['base']
: null;
}
/**
* Retrieves documentation about a shape, specific to the context.
*
* @param string $shapeName Name of the shape.
* @param string $parentName Name of the parent/context shape.
* @param string $ref Name used by the context to reference the shape.
*
* @return null|string
*/
public function getShapeDocs($shapeName, $parentName, $ref)
{
if (!isset($this->docs['shapes'][$shapeName])) {
return '';
}
$result = '';
$d = $this->docs['shapes'][$shapeName];
if (isset($d['refs']["{$parentName}\${$ref}"])) {
$result = $d['refs']["{$parentName}\${$ref}"];
} elseif (isset($d['base'])) {
$result = $d['base'];
}
if (isset($d['append'])) {
if (!isset($d['excludeAppend'])
|| !in_array($parentName, $d['excludeAppend'])
) {
$result .= $d['append'];
}
}
if (isset($d['appendOnly'])
&& in_array($parentName, $d['appendOnly']['shapes'])
) {
$result .= $d['appendOnly']['message'];
}
return $this->clean($result);
}
private function clean($content)
{
if (!$content) {
return '';
}
$tidy = new \tidy();
$tidy->parseString($content, [
'indent' => true,
'doctype' => 'omit',
'output-html' => true,
'show-body-only' => true,
'drop-empty-paras' => true,
'clean' => true,
'drop-proprietary-attributes' => true,
'hide-comments' => true,
'logical-emphasis' => true
]);
$tidy->cleanRepair();
return (string) $content;
}
}

View file

@ -0,0 +1,99 @@
<?php
namespace Aws\Api\ErrorParser;
use Aws\Api\Parser\MetadataParserTrait;
use Aws\Api\Parser\PayloadParserTrait;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
abstract class AbstractErrorParser
{
use MetadataParserTrait;
use PayloadParserTrait;
/**
* @var Service
*/
protected $api;
/**
* @param Service $api
*/
public function __construct(?Service $api = null)
{
$this->api = $api;
}
abstract protected function payload(
ResponseInterface $response,
StructureShape $member
);
protected function extractPayload(
StructureShape $member,
ResponseInterface $response
) {
if ($member instanceof StructureShape) {
// Structure members parse top-level data into a specific key.
return $this->payload($response, $member);
} else {
// Streaming data is just the stream from the response body.
return $response->getBody();
}
}
protected function populateShape(
array &$data,
ResponseInterface $response,
?CommandInterface $command = null
) {
$data['body'] = [];
if (!empty($command) && !empty($this->api)) {
// If modeled error code is indicated, check for known error shape
if (!empty($data['code'])) {
$errors = $this->api->getOperation($command->getName())->getErrors();
foreach ($errors as $key => $error) {
// If error code matches a known error shape, populate the body
if ($this->errorCodeMatches($data, $error)) {
$modeledError = $error;
$data['body'] = $this->extractPayload(
$modeledError,
$response
);
$data['error_shape'] = $modeledError;
foreach ($error->getMembers() as $name => $member) {
switch ($member['location']) {
case 'header':
$this->extractHeader($name, $member, $response, $data['body']);
break;
case 'headers':
$this->extractHeaders($name, $member, $response, $data['body']);
break;
case 'statusCode':
$this->extractStatus($name, $response, $data['body']);
break;
}
}
break;
}
}
}
}
return $data;
}
private function errorCodeMatches(array $data, $error): bool
{
return $data['code'] == $error['name']
|| (isset($error['error']['code']) && $data['code'] === $error['error']['code']);
}
}

View file

@ -0,0 +1,144 @@
<?php
namespace Aws\Api\ErrorParser;
use Aws\Api\Parser\PayloadParserTrait;
use Aws\Api\StructureShape;
use Psr\Http\Message\ResponseInterface;
/**
* Provides basic JSON error parsing functionality.
*/
trait JsonParserTrait
{
use PayloadParserTrait;
private function genericHandler(ResponseInterface $response): array
{
$code = (string) $response->getStatusCode();
$error_code = null;
$error_type = null;
// Parse error code and type for query compatible services
if ($this->api
&& !is_null($this->api->getMetadata('awsQueryCompatible'))
&& $response->hasHeader('x-amzn-query-error')
) {
$awsQueryError = $this->parseAwsQueryCompatibleHeader($response);
if ($awsQueryError) {
$error_code = $awsQueryError['code'];
$error_type = $awsQueryError['type'];
}
}
// Parse error code from X-Amzn-Errortype header
if (!$error_code && $response->hasHeader('X-Amzn-Errortype')) {
$error_code = $this->extractErrorCode(
$response->getHeaderLine('X-Amzn-Errortype')
);
}
$parsedBody = null;
$body = $response->getBody();
if (!$body->isSeekable() || $body->getSize()) {
$parsedBody = $this->parseJson((string) $body, $response);
}
// Parse error code from response body
if (!$error_code && $parsedBody) {
$error_code = $this->parseErrorFromBody($parsedBody);
}
if (!isset($error_type)) {
$error_type = $code[0] == '4' ? 'client' : 'server';
}
return [
'request_id' => $response->getHeaderLine('x-amzn-requestid'),
'code' => $error_code ?? null,
'message' => null,
'type' => $error_type,
'parsed' => $parsedBody
];
}
/**
* Parse AWS Query Compatible error from header
*
* @param ResponseInterface $response
* @return array|null Returns ['code' => string, 'type' => string] or null
*/
private function parseAwsQueryCompatibleHeader(ResponseInterface $response): ?array
{
$queryError = $response->getHeaderLine('x-amzn-query-error');
$parts = explode(';', $queryError);
if (count($parts) === 2 && $parts[0] && $parts[1]) {
return [
'code' => $parts[0],
'type' => $parts[1]
];
}
return null;
}
/**
* Parse error code from response body
*
* @param array|null $parsedBody
* @return string|null
*/
private function parseErrorFromBody(?array $parsedBody): ?string
{
if (!$parsedBody
|| (!isset($parsedBody['code']) && !isset($parsedBody['__type']))
) {
return null;
}
$error_code = $parsedBody['code'] ?? $parsedBody['__type'];
return $this->extractErrorCode($error_code);
}
/**
* Extract error code from raw error string containing # and/or : delimiters
*
* @param string $rawErrorCode
* @return string
*/
private function extractErrorCode(string $rawErrorCode): string
{
// Handle format with both # and uri (e.g., "namespace#http://foo-bar")
if (str_contains($rawErrorCode, ':') && str_contains($rawErrorCode, '#')) {
$start = strpos($rawErrorCode, '#') + 1;
$end = strpos($rawErrorCode, ':', $start);
return substr($rawErrorCode, $start, $end - $start);
}
// Handle format with uri only : (e.g., "ErrorCode:http://foo-bar.com/baz")
if (str_contains($rawErrorCode, ':')) {
return substr($rawErrorCode, 0, strpos($rawErrorCode, ':'));
}
// Handle format with only # (e.g., "namespace#ErrorCode")
if (str_contains($rawErrorCode, '#')) {
return substr($rawErrorCode, strpos($rawErrorCode, '#') + 1);
}
return $rawErrorCode;
}
protected function payload(
ResponseInterface $response,
StructureShape $member
) {
$body = $response->getBody();
if (!$body->isSeekable() || $body->getSize()) {
$jsonBody = $this->parseJson($body, $response);
} else {
$jsonBody = (string) $body;
}
return $this->parser->parse($member, $jsonBody);
}
}

View file

@ -0,0 +1,47 @@
<?php
namespace Aws\Api\ErrorParser;
use Aws\Api\Parser\JsonParser;
use Aws\Api\Service;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Parsers JSON-RPC errors.
*/
class JsonRpcErrorParser extends AbstractErrorParser
{
use JsonParserTrait;
private $parser;
public function __construct(?Service $api = null, ?JsonParser $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
}
public function __invoke(
ResponseInterface $response,
?CommandInterface $command = null
) {
$data = $this->genericHandler($response);
// Make the casing consistent across services.
if ($data['parsed']) {
$data['parsed'] = array_change_key_case($data['parsed']);
}
if (isset($data['parsed']['__type'])) {
if (!isset($data['code'])) {
$parts = explode('#', $data['parsed']['__type']);
$data['code'] = isset($parts[1]) ? $parts[1] : $parts[0];
}
$data['message'] = $data['parsed']['message'] ?? null;
}
$this->populateShape($data, $response, $command);
return $data;
}
}

View file

@ -0,0 +1,49 @@
<?php
namespace Aws\Api\ErrorParser;
use Aws\Api\Parser\JsonParser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Parses JSON-REST errors.
*/
class RestJsonErrorParser extends AbstractErrorParser
{
use JsonParserTrait;
private $parser;
public function __construct(?Service $api = null, ?JsonParser $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
}
public function __invoke(
ResponseInterface $response,
?CommandInterface $command = null
) {
$data = $this->genericHandler($response);
// Merge in error data from the JSON body
if ($json = $data['parsed']) {
$data = array_replace($json, $data);
}
// Correct error type from services like Amazon Glacier
if (!empty($data['type'])) {
$data['type'] = strtolower($data['type']);
}
// Retrieve error message directly
$data['message'] = $data['parsed']['message']
?? ($data['parsed']['Message'] ?? null);
$this->populateShape($data, $response, $command);
return $data;
}
}

View file

@ -0,0 +1,111 @@
<?php
namespace Aws\Api\ErrorParser;
use Aws\Api\Parser\PayloadParserTrait;
use Aws\Api\Parser\XmlParser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Parses XML errors.
*/
class XmlErrorParser extends AbstractErrorParser
{
use PayloadParserTrait;
protected $parser;
public function __construct(?Service $api = null, ?XmlParser $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new XmlParser();
}
public function __invoke(
ResponseInterface $response,
?CommandInterface $command = null
) {
$code = (string) $response->getStatusCode();
$data = [
'type' => $code[0] == '4' ? 'client' : 'server',
'request_id' => null,
'code' => null,
'message' => null,
'parsed' => null
];
$body = $response->getBody();
if ($body->getSize() > 0) {
$this->parseBody($this->parseXml($body, $response), $data);
} else {
$this->parseHeaders($response, $data);
}
$this->populateShape($data, $response, $command);
return $data;
}
private function parseHeaders(ResponseInterface $response, array &$data)
{
if ($response->getStatusCode() == '404') {
$data['code'] = 'NotFound';
}
$data['message'] = $response->getStatusCode() . ' '
. $response->getReasonPhrase();
if ($requestId = $response->getHeaderLine('x-amz-request-id')) {
$data['request_id'] = $requestId;
$data['message'] .= " (Request-ID: $requestId)";
}
}
private function parseBody(\SimpleXMLElement $body, array &$data)
{
$data['parsed'] = $body;
$prefix = $this->registerNamespacePrefix($body);
if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
$data['code'] = (string) $tempXml[0];
}
if ($tempXml = $body->xpath("//{$prefix}Message[1]")) {
$data['message'] = (string) $tempXml[0];
}
$tempXml = $body->xpath("//{$prefix}RequestId[1]");
if (isset($tempXml[0])) {
$data['request_id'] = (string)$tempXml[0];
}
}
protected function registerNamespacePrefix(\SimpleXMLElement $element)
{
$namespaces = $element->getDocNamespaces();
if (!isset($namespaces[''])) {
return '';
}
// Account for the default namespace being defined and PHP not
// being able to handle it :(.
$element->registerXPathNamespace('ns', $namespaces['']);
return 'ns:';
}
protected function payload(
ResponseInterface $response,
StructureShape $member
) {
$xmlBody = $this->parseXml($response->getBody(), $response);
$prefix = $this->registerNamespacePrefix($xmlBody);
$errorBody = $xmlBody->xpath("//{$prefix}Error");
if (is_array($errorBody) && !empty($errorBody[0])) {
return $this->parser->parse($member, $errorBody[0]);
}
}
}

View file

@ -0,0 +1,35 @@
<?php
namespace Aws\Api;
/**
* Represents a list shape.
*/
class ListShape extends Shape
{
private $member;
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'list';
parent::__construct($definition, $shapeMap);
}
/**
* @return Shape
* @throws \RuntimeException if no member is specified
*/
public function getMember()
{
if (!$this->member) {
if (!isset($this->definition['member'])) {
throw new \RuntimeException('No member attribute specified');
}
$this->member = Shape::create(
$this->definition['member'],
$this->shapeMap
);
}
return $this->member;
}
}

View file

@ -0,0 +1,54 @@
<?php
namespace Aws\Api;
/**
* Represents a map shape.
*/
class MapShape extends Shape
{
/** @var Shape */
private $value;
/** @var Shape */
private $key;
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'map';
parent::__construct($definition, $shapeMap);
}
/**
* @return Shape
* @throws \RuntimeException if no value is specified
*/
public function getValue()
{
if (!$this->value) {
if (!isset($this->definition['value'])) {
throw new \RuntimeException('No value specified');
}
$this->value = Shape::create(
$this->definition['value'],
$this->shapeMap
);
}
return $this->value;
}
/**
* @return Shape
*/
public function getKey()
{
if (!$this->key) {
$this->key = isset($this->definition['key'])
? Shape::create($this->definition['key'], $this->shapeMap)
: new Shape(['type' => 'string'], $this->shapeMap);
}
return $this->key;
}
}

View file

@ -0,0 +1,158 @@
<?php
namespace Aws\Api;
/**
* Represents an API operation.
*/
class Operation extends AbstractModel
{
private $input;
private $output;
private $errors;
private $staticContextParams = [];
private $contextParams;
private $operationContextParams = [];
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'structure';
if (!isset($definition['http']['method'])) {
$definition['http']['method'] = 'POST';
}
if (!isset($definition['http']['requestUri'])) {
$definition['http']['requestUri'] = '/';
}
if (isset($definition['staticContextParams'])) {
$this->staticContextParams = $definition['staticContextParams'];
}
if (isset($definition['operationContextParams'])) {
$this->operationContextParams = $definition['operationContextParams'];
}
parent::__construct($definition, $shapeMap);
$this->contextParams = $this->setContextParams();
}
/**
* Returns an associative array of the HTTP attribute of the operation:
*
* - method: HTTP method of the operation
* - requestUri: URI of the request (can include URI template placeholders)
*
* @return array
*/
public function getHttp()
{
return $this->definition['http'];
}
/**
* Get the input shape of the operation.
*
* @return StructureShape
*/
public function getInput()
{
if (!$this->input) {
if ($input = $this['input']) {
$this->input = $this->shapeFor($input);
} else {
$this->input = new StructureShape([], $this->shapeMap);
}
}
return $this->input;
}
/**
* Get the output shape of the operation.
*
* @return StructureShape
*/
public function getOutput()
{
if (!$this->output) {
if ($output = $this['output']) {
$this->output = $this->shapeFor($output);
} else {
$this->output = new StructureShape([], $this->shapeMap);
}
}
return $this->output;
}
/**
* Get an array of operation error shapes.
*
* @return Shape[]
*/
public function getErrors()
{
if ($this->errors === null) {
if ($errors = $this['errors']) {
foreach ($errors as $key => $error) {
$errors[$key] = $this->shapeFor($error);
}
$this->errors = $errors;
} else {
$this->errors = [];
}
}
return $this->errors;
}
/**
* Gets static modeled static values used for
* endpoint resolution.
*
* @return array
*/
public function getStaticContextParams()
{
return $this->staticContextParams;
}
/**
* Gets definition of modeled dynamic values used
* for endpoint resolution
*
* @return array
*/
public function getContextParams()
{
return $this->contextParams;
}
/**
* Gets definition of modeled dynamic values used
* for endpoint resolution
*
* @return array
*/
public function getOperationContextParams(): array
{
return $this->operationContextParams;
}
private function setContextParams()
{
$members = $this->getInput()->getMembers();
$contextParams = [];
foreach($members as $name => $shape) {
if (!empty($contextParam = $shape->getContextParam())) {
$contextParams[$contextParam['name']] = [
'shape' => $name,
'type' => $shape->getType()
];
}
}
return $contextParams;
}
}

View file

@ -0,0 +1,46 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\CommandInterface;
use Aws\ResultInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* @internal
*/
abstract class AbstractParser
{
/** @var \Aws\Api\Service Representation of the service API*/
protected $api;
/** @var callable */
protected $parser;
/**
* @param Service $api Service description.
*/
public function __construct(Service $api)
{
$this->api = $api;
}
/**
* @param CommandInterface $command Command that was executed.
* @param ResponseInterface $response Response that was received.
*
* @return ResultInterface
*/
abstract public function __invoke(
CommandInterface $command,
ResponseInterface $response
);
abstract public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
);
}

View file

@ -0,0 +1,216 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\DateTimeResult;
use Aws\Api\Shape;
use Aws\Api\StructureShape;
use Aws\Result;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
/**
* @internal
*/
abstract class AbstractRestParser extends AbstractParser
{
use PayloadParserTrait;
/**
* Parses a payload from a response.
*
* @param ResponseInterface $response Response to parse.
* @param StructureShape $member Member to parse
* @param array $result Result value
*
* @return mixed
*/
abstract protected function payload(
ResponseInterface $response,
StructureShape $member,
array &$result
);
public function __invoke(
CommandInterface $command,
ResponseInterface $response
) {
$output = $this->api->getOperation($command->getName())->getOutput();
$result = [];
if ($payload = $output['payload']) {
$this->extractPayload($payload, $output, $response, $result);
}
foreach ($output->getMembers() as $name => $member) {
switch ($member['location']) {
case 'header':
$this->extractHeader($name, $member, $response, $result);
break;
case 'headers':
$this->extractHeaders($name, $member, $response, $result);
break;
case 'statusCode':
$this->extractStatus($name, $response, $result);
break;
}
}
$body = $response->getBody();
if (!$payload
&& (!$body->isSeekable() || $body->getSize())
&& count($output->getMembers()) > 0
) {
// if no payload was found, then parse the contents of the body
$this->payload($response, $output, $result);
}
return new Result($result);
}
private function extractPayload(
$payload,
StructureShape $output,
ResponseInterface $response,
array &$result
) {
$member = $output->getMember($payload);
$body = $response->getBody();
if (!empty($member['eventstream'])) {
$result[$payload] = new EventParsingIterator(
$body,
$member,
$this
);
} elseif ($member instanceof StructureShape) {
//Unions must have at least one member set to a non-null value
// If the body is empty, we can assume it is unset
if (!empty($member['union']) && ($body->isSeekable() && !$body->getSize())) {
return;
}
$result[$payload] = [];
$this->payload($response, $member, $result[$payload]);
} else {
// Always set the payload to the body stream, regardless of content
$result[$payload] = $body;
}
}
/**
* Extract a single header from the response into the result.
*/
private function extractHeader(
$name,
Shape $shape,
ResponseInterface $response,
&$result
) {
$value = $response->getHeaderLine($shape['locationName'] ?: $name);
// Empty headers should not be deserialized
if ($value === null || $value === '') {
return;
}
switch ($shape->getType()) {
case 'float':
case 'double':
$value = match ($value) {
'NaN', 'Infinity', '-Infinity' => $value,
default => (float) $value
};
break;
case 'long':
case 'integer':
$value = (int) $value;
break;
case 'boolean':
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
break;
case 'blob':
$value = base64_decode($value);
break;
case 'timestamp':
try {
$value = DateTimeResult::fromTimestamp(
$value,
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
);
break;
} catch (\Exception $e) {
// If the value cannot be parsed, then do not add it to the
// output structure.
return;
}
case 'string':
try {
if ($shape['jsonvalue']) {
$value = $this->parseJson(base64_decode($value), $response);
}
// If value is not set, do not add to output structure.
if (!isset($value)) {
return;
}
break;
} catch (\Exception $e) {
//If the value cannot be parsed, then do not add it to the
//output structure.
return;
}
case 'list':
$listMember = $shape->getMember();
$type = $listMember->getType();
// Only boolean lists require special handling
// other types can be returned as-is
if ($type !== 'boolean') {
break;
}
$items = array_map('trim', explode(',', $value));
$value = array_map(
static fn($item) => filter_var($item, FILTER_VALIDATE_BOOLEAN),
$items
);
break;
}
$result[$name] = $value;
}
/**
* Extract a map of headers with an optional prefix from the response.
*/
private function extractHeaders(
$name,
Shape $shape,
ResponseInterface $response,
&$result
) {
// Check if the headers are prefixed by a location name
$result[$name] = [];
$prefix = $shape['locationName'];
$prefixLen = $prefix !== null ? strlen($prefix) : 0;
foreach ($response->getHeaders() as $k => $values) {
if (!$prefixLen) {
$result[$name][$k] = implode(', ', $values);
} elseif (stripos($k, $prefix) === 0) {
$result[$name][substr($k, $prefixLen)] = implode(', ', $values);
}
}
}
/**
* Places the status code of the response into the result array.
*/
private function extractStatus(
$name,
ResponseInterface $response,
array &$result
) {
$result[$name] = (int) $response->getStatusCode();
}
}

View file

@ -0,0 +1,54 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\StructureShape;
use Aws\CommandInterface;
use Aws\Exception\AwsException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
use GuzzleHttp\Psr7;
/**
* @internal Decorates a parser and validates the x-amz-crc32 header.
*/
class Crc32ValidatingParser extends AbstractParser
{
/**
* @param callable $parser Parser to wrap.
*/
public function __construct(callable $parser)
{
$this->parser = $parser;
}
public function __invoke(
CommandInterface $command,
ResponseInterface $response
) {
if ($expected = $response->getHeaderLine('x-amz-crc32')) {
$hash = hexdec(Psr7\Utils::hash($response->getBody(), 'crc32b'));
if ($expected != $hash) {
throw new AwsException(
"crc32 mismatch. Expected {$expected}, found {$hash}.",
$command,
[
'code' => 'ClientChecksumMismatch',
'connection_error' => true,
'response' => $response
]
);
}
}
$fn = $this->parser;
return $fn($command, $response);
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
return $this->parser->parseMemberFromStream($stream, $member, $response);
}
}

View file

@ -0,0 +1,347 @@
<?php
namespace Aws\Api\Parser;
use \Iterator;
use Aws\Api\DateTimeResult;
use GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
use Aws\Api\Parser\Exception\ParserException;
/**
* @internal Implements a decoder for a binary encoded event stream that will
* decode, validate, and provide individual events from the stream.
*/
class DecodingEventStreamIterator implements Iterator
{
const HEADERS = 'headers';
const PAYLOAD = 'payload';
const LENGTH_TOTAL = 'total_length';
const LENGTH_HEADERS = 'headers_length';
const CRC_PRELUDE = 'prelude_crc';
const BYTES_PRELUDE = 12;
const BYTES_TRAILING = 4;
private static $preludeFormat = [
self::LENGTH_TOTAL => 'decodeUint32',
self::LENGTH_HEADERS => 'decodeUint32',
self::CRC_PRELUDE => 'decodeUint32',
];
private static $lengthFormatMap = [
1 => 'decodeUint8',
2 => 'decodeUint16',
4 => 'decodeUint32',
8 => 'decodeUint64',
];
private static $headerTypeMap = [
0 => 'decodeBooleanTrue',
1 => 'decodeBooleanFalse',
2 => 'decodeInt8',
3 => 'decodeInt16',
4 => 'decodeInt32',
5 => 'decodeInt64',
6 => 'decodeBytes',
7 => 'decodeString',
8 => 'decodeTimestamp',
9 => 'decodeUuid',
];
/** @var StreamInterface Stream of eventstream shape to parse. */
protected $stream;
/** @var array Currently parsed event. */
protected $currentEvent;
/** @var int Current in-order event key. */
protected $key;
/** @var resource|\HashContext CRC32 hash context for event validation */
protected $hashContext;
/** @var int $currentPosition */
protected $currentPosition;
/**
* DecodingEventStreamIterator constructor.
*
* @param StreamInterface $stream
*/
public function __construct(StreamInterface $stream)
{
$this->stream = $stream;
$this->rewind();
}
protected function parseHeaders($headerBytes)
{
$headers = [];
$bytesRead = 0;
while ($bytesRead < $headerBytes) {
list($key, $numBytes) = $this->decodeString(1);
$bytesRead += $numBytes;
list($type, $numBytes) = $this->decodeUint8();
$bytesRead += $numBytes;
$f = self::$headerTypeMap[$type];
list($value, $numBytes) = $this->{$f}();
$bytesRead += $numBytes;
if (isset($headers[$key])) {
throw new ParserException('Duplicate key in event headers.');
}
$headers[$key] = $value;
}
return [$headers, $bytesRead];
}
protected function parsePrelude()
{
$prelude = [];
$bytesRead = 0;
$calculatedCrc = null;
foreach (self::$preludeFormat as $key => $decodeFunction) {
if ($key === self::CRC_PRELUDE) {
$hashCopy = hash_copy($this->hashContext);
$calculatedCrc = hash_final($this->hashContext, true);
$this->hashContext = $hashCopy;
}
list($value, $numBytes) = $this->{$decodeFunction}();
$bytesRead += $numBytes;
$prelude[$key] = $value;
}
if (unpack('N', $calculatedCrc)[1] !== $prelude[self::CRC_PRELUDE]) {
throw new ParserException('Prelude checksum mismatch.');
}
return [$prelude, $bytesRead];
}
/**
* This method decodes an event from the stream.
*
* @return array
*/
protected function parseEvent()
{
$event = [];
if ($this->stream->tell() < $this->stream->getSize()) {
$this->hashContext = hash_init('crc32b');
$bytesLeft = $this->stream->getSize() - $this->stream->tell();
list($prelude, $numBytes) = $this->parsePrelude();
if ($prelude[self::LENGTH_TOTAL] > $bytesLeft) {
throw new ParserException('Message length too long.');
}
$bytesLeft -= $numBytes;
if ($prelude[self::LENGTH_HEADERS] > $bytesLeft) {
throw new ParserException('Headers length too long.');
}
list(
$event[self::HEADERS],
$numBytes
) = $this->parseHeaders($prelude[self::LENGTH_HEADERS]);
$event[self::PAYLOAD] = Psr7\Utils::streamFor(
$this->readAndHashBytes(
$prelude[self::LENGTH_TOTAL] - self::BYTES_PRELUDE
- $numBytes - self::BYTES_TRAILING
)
);
$calculatedCrc = hash_final($this->hashContext, true);
$messageCrc = $this->stream->read(4);
if ($calculatedCrc !== $messageCrc) {
throw new ParserException('Message checksum mismatch.');
}
}
return $event;
}
// Iterator Functionality
/**
* @return array
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->currentEvent;
}
/**
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->key;
}
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->currentPosition = $this->stream->tell();
if ($this->valid()) {
$this->key++;
$this->currentEvent = $this->parseEvent();
}
}
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->stream->rewind();
$this->key = 0;
$this->currentPosition = 0;
$this->currentEvent = $this->parseEvent();
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->currentPosition < $this->stream->getSize();
}
// Decoding Utilities
protected function readAndHashBytes($num)
{
$bytes = $this->stream->read($num);
hash_update($this->hashContext, $bytes);
return $bytes;
}
private function decodeBooleanTrue()
{
return [true, 0];
}
private function decodeBooleanFalse()
{
return [false, 0];
}
private function uintToInt($val, $size)
{
$signedCap = pow(2, $size - 1);
if ($val > $signedCap) {
$val -= (2 * $signedCap);
}
return $val;
}
private function decodeInt8()
{
$val = (int)unpack('C', $this->readAndHashBytes(1))[1];
return [$this->uintToInt($val, 8), 1];
}
private function decodeUint8()
{
return [unpack('C', $this->readAndHashBytes(1))[1], 1];
}
private function decodeInt16()
{
$val = (int)unpack('n', $this->readAndHashBytes(2))[1];
return [$this->uintToInt($val, 16), 2];
}
private function decodeUint16()
{
return [unpack('n', $this->readAndHashBytes(2))[1], 2];
}
private function decodeInt32()
{
$val = (int)unpack('N', $this->readAndHashBytes(4))[1];
return [$this->uintToInt($val, 32), 4];
}
private function decodeUint32()
{
return [unpack('N', $this->readAndHashBytes(4))[1], 4];
}
private function decodeInt64()
{
$val = $this->unpackInt64($this->readAndHashBytes(8))[1];
return [$this->uintToInt($val, 64), 8];
}
private function decodeUint64()
{
return [$this->unpackInt64($this->readAndHashBytes(8))[1], 8];
}
private function unpackInt64($bytes)
{
return unpack('J', $bytes);
}
private function decodeBytes($lengthBytes=2)
{
if (!isset(self::$lengthFormatMap[$lengthBytes])) {
throw new ParserException('Undefined variable length format.');
}
$f = self::$lengthFormatMap[$lengthBytes];
list($len, $bytes) = $this->{$f}();
return [$this->readAndHashBytes($len), $len + $bytes];
}
private function decodeString($lengthBytes=2)
{
if (!isset(self::$lengthFormatMap[$lengthBytes])) {
throw new ParserException('Undefined variable length format.');
}
$f = self::$lengthFormatMap[$lengthBytes];
list($len, $bytes) = $this->{$f}();
return [$this->readAndHashBytes($len), $len + $bytes];
}
private function decodeTimestamp()
{
list($val, $bytes) = $this->decodeInt64();
return [
DateTimeResult::createFromFormat('U.u', $val / 1000),
$bytes
];
}
private function decodeUuid()
{
$val = unpack('H32', $this->readAndHashBytes(16))[1];
return [
substr($val, 0, 8) . '-'
. substr($val, 8, 4) . '-'
. substr($val, 12, 4) . '-'
. substr($val, 16, 4) . '-'
. substr($val, 20, 12),
16
];
}
}

View file

@ -0,0 +1,211 @@
<?php
namespace Aws\Api\Parser;
use \Iterator;
use Aws\Exception\EventStreamDataException;
use Aws\Api\Parser\Exception\ParserException;
use Aws\Api\StructureShape;
use Psr\Http\Message\StreamInterface;
/**
* @internal Implements a decoder for a binary encoded event stream that will
* decode, validate, and provide individual events from the stream.
*/
class EventParsingIterator implements Iterator
{
/** @var StreamInterface */
private $decodingIterator;
/** @var StructureShape */
private $shape;
/** @var AbstractParser */
private $parser;
public function __construct(
StreamInterface $stream,
StructureShape $shape,
AbstractParser $parser
) {
$this->decodingIterator = $this->chooseDecodingIterator($stream);
$this->shape = $shape;
$this->parser = $parser;
}
/**
* This method choose a decoding iterator implementation based on if the stream
* is seekable or not.
*
* @param $stream
*
* @return Iterator
*/
private function chooseDecodingIterator($stream)
{
if ($stream->isSeekable()) {
return new DecodingEventStreamIterator($stream);
} else {
return new NonSeekableStreamDecodingEventStreamIterator($stream);
}
}
/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->parseEvent($this->decodingIterator->current());
}
/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->decodingIterator->key();
}
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->decodingIterator->next();
}
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->decodingIterator->rewind();
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->decodingIterator->valid();
}
private function parseEvent(array $event)
{
if (!empty($event['headers'][':message-type'])) {
if ($event['headers'][':message-type'] === 'error') {
return $this->parseError($event);
}
if ($event['headers'][':message-type'] === 'exception') {
return $this->parseException($event);
}
if ($event['headers'][':message-type'] !== 'event') {
throw new ParserException('Failed to parse unknown message type.');
}
}
$eventType = $event['headers'][':event-type'] ?? null;
if (empty($eventType)) {
throw new ParserException('Failed to parse without event type.');
}
$eventPayload = $event['payload'];
if ($eventType === 'initial-response') {
return $this->parseInitialResponseEvent($eventPayload);
}
$eventShape = $this->shape->getMember($eventType);
return [
$eventType => array_merge(
$this->parseEventHeaders($event['headers'], $eventShape),
$this->parseEventPayload($eventPayload, $eventShape)
)
];
}
/**
* @param $headers
* @param $eventShape
*
* @return array
*/
private function parseEventHeaders($headers, $eventShape): array
{
$parsedHeaders = [];
foreach ($eventShape->getMembers() as $memberName => $memberProps) {
if (isset($memberProps['eventheader'])) {
$parsedHeaders[$memberName] = $headers[$memberName];
}
}
return $parsedHeaders;
}
/**
* @param $payload
* @param $eventShape
*
* @return array
*/
private function parseEventPayload($payload, $eventShape): array
{
$parsedPayload = [];
foreach ($eventShape->getMembers() as $memberName => $memberProps) {
$memberShape = $eventShape->getMember($memberName);
if (isset($memberProps['eventpayload'])) {
if ($memberShape->getType() === 'blob') {
$parsedPayload[$memberName] = $payload;
} else {
$parsedPayload[$memberName] = $this->parser->parseMemberFromStream(
$payload,
$memberShape,
null
);
}
break;
}
}
if (empty($parsedPayload) && !empty($payload->getContents())) {
/**
* If we did not find a member with an eventpayload trait, then we should deserialize the payload
* using the event's shape.
*/
$parsedPayload = $this->parser->parseMemberFromStream($payload, $eventShape, null);
}
return $parsedPayload;
}
private function parseError(array $event)
{
throw new EventStreamDataException(
$event['headers'][':error-code'],
$event['headers'][':error-message']
);
}
private function parseException(array $event) {
$payload = $event['payload']?->getContents();
$parsedPayload = json_decode($payload, true);
throw new EventStreamDataException(
$event['headers'][':exception-type'] ?? 'Unknown',
$parsedPayload['message'] ?? $payload,
);
}
private function parseInitialResponseEvent($payload): array
{
return ['initial-response' => json_decode($payload, true)];
}
}

View file

@ -0,0 +1,56 @@
<?php
namespace Aws\Api\Parser\Exception;
use Aws\HasMonitoringEventsTrait;
use Aws\MonitoringEventsInterface;
use Aws\ResponseContainerInterface;
use Psr\Http\Message\ResponseInterface;
class ParserException extends \RuntimeException implements
MonitoringEventsInterface,
ResponseContainerInterface
{
use HasMonitoringEventsTrait;
private $errorCode;
private $requestId;
private $response;
public function __construct($message = '', $code = 0, $previous = null, array $context = [])
{
$this->errorCode = isset($context['error_code']) ? $context['error_code'] : null;
$this->requestId = isset($context['request_id']) ? $context['request_id'] : null;
$this->response = isset($context['response']) ? $context['response'] : null;
parent::__construct($message, $code, $previous);
}
/**
* Get the error code, if any.
*
* @return string|null
*/
public function getErrorCode()
{
return $this->errorCode;
}
/**
* Get the request ID, if any.
*
* @return string|null
*/
public function getRequestId()
{
return $this->requestId;
}
/**
* Get the received HTTP response if any.
*
* @return ResponseInterface|null
*/
public function getResponse()
{
return $this->response;
}
}

View file

@ -0,0 +1,74 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\DateTimeResult;
use Aws\Api\Shape;
/**
* @internal Implements standard JSON parsing.
*/
class JsonParser
{
public function parse(Shape $shape, $value)
{
if ($value === null) {
return $value;
}
switch ($shape['type']) {
case 'structure':
if (isset($shape['document']) && $shape['document']) {
return $value;
}
$target = [];
foreach ($shape->getMembers() as $name => $member) {
$locationName = $member['locationName'] ?: $name;
if (isset($value[$locationName])) {
$target[$name] = $this->parse($member, $value[$locationName]);
}
}
if (isset($shape['union'])
&& $shape['union']
&& is_array($value)
&& empty($target)
) {
foreach ($value as $key => $val) {
$target['Unknown'][$key] = $val;
}
}
return $target;
case 'list':
$member = $shape->getMember();
$target = [];
foreach ($value as $v) {
$target[] = $this->parse($member, $v);
}
return $target;
case 'map':
$values = $shape->getValue();
$target = [];
foreach ($value as $k => $v) {
// null map values should not be deserialized
if (!is_null($v)) {
$target[$k] = $this->parse($values, $v);
}
}
return $target;
case 'timestamp':
return DateTimeResult::fromTimestamp(
$value,
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
);
case 'blob':
return base64_decode($value);
default:
return $value;
}
}
}

View file

@ -0,0 +1,82 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\Operation;
use Aws\Api\StructureShape;
use Aws\Api\Service;
use Aws\Result;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* @internal Implements JSON-RPC parsing (e.g., DynamoDB)
*/
class JsonRpcParser extends AbstractParser
{
use PayloadParserTrait;
/**
* @param Service $api Service description
* @param JsonParser $parser JSON body builder
*/
public function __construct(Service $api, ?JsonParser $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
}
public function __invoke(
CommandInterface $command,
ResponseInterface $response
) {
$operation = $this->api->getOperation($command->getName());
return $this->parseResponse($response, $operation);
}
/**
* This method parses a response based on JSON RPC protocol.
*
* @param ResponseInterface $response the response to parse.
* @param Operation $operation the operation which holds information for
* parsing the response.
*
* @return Result
*/
private function parseResponse(ResponseInterface $response, Operation $operation)
{
if (null === $operation['output']) {
return new Result([]);
}
$outputShape = $operation->getOutput();
foreach ($outputShape->getMembers() as $memberName => $memberProps) {
if (!empty($memberProps['eventstream'])) {
return new Result([
$memberName => new EventParsingIterator(
$response->getBody(),
$outputShape->getMember($memberName),
$this
)
]);
}
}
$result = $this->parseMemberFromStream(
$response->getBody(),
$operation->getOutput(),
$response
);
return new Result(is_null($result) ? [] : $result);
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
return $this->parser->parse($member, $this->parseJson($stream, $response));
}
}

View file

@ -0,0 +1,95 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\DateTimeResult;
use Aws\Api\Shape;
use Psr\Http\Message\ResponseInterface;
trait MetadataParserTrait
{
/**
* Extract a single header from the response into the result.
*/
protected function extractHeader(
$name,
Shape $shape,
ResponseInterface $response,
&$result
) {
$value = $response->getHeaderLine($shape['locationName'] ?: $name);
// Empty values should not be deserialized
if ($value === null || $value === '') {
return;
}
switch ($shape->getType()) {
case 'float':
case 'double':
$value = (float) $value;
break;
case 'long':
case 'integer':
$value = (int) $value;
break;
case 'boolean':
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
break;
case 'blob':
$value = base64_decode($value);
break;
case 'timestamp':
try {
$value = DateTimeResult::fromTimestamp(
$value,
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
);
break;
} catch (\Exception $e) {
// If the value cannot be parsed, then do not add it to the
// output structure.
return;
}
case 'string':
if ($shape['jsonvalue']) {
$value = $this->parseJson(base64_decode($value), $response);
}
break;
}
$result[$name] = $value;
}
/**
* Extract a map of headers with an optional prefix from the response.
*/
protected function extractHeaders(
$name,
Shape $shape,
ResponseInterface $response,
&$result
) {
// Check if the headers are prefixed by a location name
$result[$name] = [];
$prefix = $shape['locationName'];
$prefixLen = strlen($prefix);
foreach ($response->getHeaders() as $k => $values) {
if (!$prefixLen) {
$result[$name][$k] = implode(', ', $values);
} elseif (stripos($k, $prefix) === 0) {
$result[$name][substr($k, $prefixLen)] = implode(', ', $values);
}
}
}
/**
* Places the status code of the response into the result array.
*/
protected function extractStatus(
$name,
ResponseInterface $response,
array &$result
) {
$result[$name] = (int) $response->getStatusCode();
}
}

View file

@ -0,0 +1,101 @@
<?php
namespace Aws\Api\Parser;
use GuzzleHttp\Psr7;
use Psr\Http\Message\StreamInterface;
use Aws\Api\Parser\Exception\ParserException;
/**
* @inheritDoc
*/
class NonSeekableStreamDecodingEventStreamIterator extends DecodingEventStreamIterator
{
/** @var array $tempBuffer */
private $tempBuffer;
/**
* NonSeekableStreamDecodingEventStreamIterator constructor.
*
* @param StreamInterface $stream
*/
public function __construct(StreamInterface $stream)
{
$this->stream = $stream;
if ($this->stream->isSeekable()) {
throw new \InvalidArgumentException('The stream provided must be not seekable.');
}
$this->tempBuffer = [];
}
/**
* @inheritDoc
*
* @return array
*/
protected function parseEvent(): array
{
$event = [];
$this->hashContext = hash_init('crc32b');
$prelude = $this->parsePrelude()[0];
list(
$event[self::HEADERS],
$numBytes
) = $this->parseHeaders($prelude[self::LENGTH_HEADERS]);
$event[self::PAYLOAD] = Psr7\Utils::streamFor(
$this->readAndHashBytes(
$prelude[self::LENGTH_TOTAL] - self::BYTES_PRELUDE
- $numBytes - self::BYTES_TRAILING
)
);
$calculatedCrc = hash_final($this->hashContext, true);
$messageCrc = $this->stream->read(4);
if ($calculatedCrc !== $messageCrc) {
throw new ParserException('Message checksum mismatch.');
}
return $event;
}
protected function readAndHashBytes($num): string
{
$bytes = '';
while (!empty($this->tempBuffer) && $num > 0) {
$byte = array_shift($this->tempBuffer);
$bytes .= $byte;
$num = $num - 1;
}
$bytes = $bytes . $this->stream->read($num);
hash_update($this->hashContext, $bytes);
return $bytes;
}
// Iterator Functionality
#[\ReturnTypeWillChange]
public function rewind()
{
$this->currentEvent = $this->parseEvent();
}
public function next()
{
$this->tempBuffer[] = $this->stream->read(1);
if ($this->valid()) {
$this->key++;
$this->currentEvent = $this->parseEvent();
}
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return !$this->stream->eof();
}
}

View file

@ -0,0 +1,61 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\Parser\Exception\ParserException;
use Psr\Http\Message\ResponseInterface;
trait PayloadParserTrait
{
/**
* @param string $json
*
* @throws ParserException
*
* @return array
*/
private function parseJson($json, $response)
{
$jsonPayload = json_decode($json, true);
if (JSON_ERROR_NONE !== json_last_error()) {
throw new ParserException(
'Error parsing JSON: ' . json_last_error_msg(),
0,
null,
['response' => $response]
);
}
return $jsonPayload;
}
/**
* @param string $xml
*
* @throws ParserException
*
* @return \SimpleXMLElement
*/
protected function parseXml($xml, $response)
{
$priorSetting = libxml_use_internal_errors(true);
try {
libxml_clear_errors();
$xmlPayload = new \SimpleXMLElement($xml);
if ($error = libxml_get_last_error()) {
throw new \RuntimeException($error->message);
}
} catch (\Exception $e) {
throw new ParserException(
"Error parsing XML: {$e->getMessage()}",
0,
$e,
['response' => $response]
);
} finally {
libxml_use_internal_errors($priorSetting);
}
return $xmlPayload;
}
}

View file

@ -0,0 +1,68 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\Result;
use Aws\CommandInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* @internal Parses query (XML) responses (e.g., EC2, SQS, and many others)
*/
class QueryParser extends AbstractParser
{
use PayloadParserTrait;
/** @var bool */
private $honorResultWrapper;
/**
* @param Service $api Service description
* @param XmlParser $xmlParser Optional XML parser
* @param bool $honorResultWrapper Set to false to disable the peeling
* back of result wrappers from the
* output structure.
*/
public function __construct(
Service $api,
?XmlParser $xmlParser = null,
$honorResultWrapper = true
) {
parent::__construct($api);
$this->parser = $xmlParser ?: new XmlParser();
$this->honorResultWrapper = $honorResultWrapper;
}
public function __invoke(
CommandInterface $command,
ResponseInterface $response
) {
$output = $this->api->getOperation($command->getName())->getOutput();
$body = $response->getBody();
$xml = !$body->isSeekable() || $body->getSize()
? $this->parseXml($body, $response)
: null;
// Empty request bodies should not be deserialized.
if (is_null($xml)) {
return new Result();
}
if ($this->honorResultWrapper && $output['resultWrapper']) {
$xml = $xml->{$output['resultWrapper']};
}
return new Result($this->parser->parse($output, $xml));
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
$xml = $this->parseXml($stream, $response);
return $this->parser->parse($member, $xml);
}
}

View file

@ -0,0 +1,64 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* @internal Implements REST-JSON parsing (e.g., Glacier, Elastic Transcoder)
*/
class RestJsonParser extends AbstractRestParser
{
use PayloadParserTrait;
/**
* @param Service $api Service description
* @param JsonParser $parser JSON body builder
*/
public function __construct(Service $api, ?JsonParser $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new JsonParser();
}
protected function payload(
ResponseInterface $response,
StructureShape $member,
array &$result
) {
$responseBody = (string) $response->getBody();
// Parse JSON if we have content
$parsedJson = null;
if (!empty($responseBody)) {
$parsedJson = $this->parseJson($responseBody, $response);
} else {
// An empty response body should be deserialized as null
$result = $parsedJson;
return;
}
$parsedBody = $this->parser->parse($member, $parsedJson);
if (is_string($parsedBody) && $member['document']) {
// Document types can be strings: replace entire result
$result = $parsedBody;
} else {
// Merge array/object results into existing result
$result = array_merge($result, (array) $parsedBody);
}
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
$jsonBody = $this->parseJson($stream, $response);
if ($jsonBody) {
return $this->parser->parse($member, $jsonBody);
}
return [];
}
}

View file

@ -0,0 +1,42 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\StructureShape;
use Aws\Api\Service;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* @internal Implements REST-XML parsing (e.g., S3, CloudFront, etc...)
*/
class RestXmlParser extends AbstractRestParser
{
use PayloadParserTrait;
/**
* @param Service $api Service description
* @param XmlParser $parser XML body parser
*/
public function __construct(Service $api, ?XmlParser $parser = null)
{
parent::__construct($api);
$this->parser = $parser ?: new XmlParser();
}
protected function payload(
ResponseInterface $response,
StructureShape $member,
array &$result
) {
$result += $this->parseMemberFromStream($response->getBody(), $member, $response);
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
$xml = $this->parseXml($stream, $response);
return $this->parser->parse($member, $xml);
}
}

View file

@ -0,0 +1,183 @@
<?php
namespace Aws\Api\Parser;
use Aws\Api\DateTimeResult;
use Aws\Api\ListShape;
use Aws\Api\MapShape;
use Aws\Api\Parser\Exception\ParserException;
use Aws\Api\Shape;
use Aws\Api\StructureShape;
/**
* @internal Implements standard XML parsing for REST-XML and Query protocols.
*/
class XmlParser
{
public function parse(StructureShape $shape, \SimpleXMLElement $value)
{
return $this->dispatch($shape, $value);
}
private function dispatch($shape, \SimpleXMLElement $value)
{
static $methods = [
'structure' => 'parse_structure',
'list' => 'parse_list',
'map' => 'parse_map',
'blob' => 'parse_blob',
'boolean' => 'parse_boolean',
'integer' => 'parse_integer',
'float' => 'parse_float',
'double' => 'parse_float',
'timestamp' => 'parse_timestamp',
];
$type = $shape['type'];
if (isset($methods[$type])) {
return $this->{$methods[$type]}($shape, $value);
}
return (string) $value;
}
private function parse_structure(
StructureShape $shape,
\SimpleXMLElement $value
) {
$target = [];
foreach ($shape->getMembers() as $name => $member) {
// Extract the name of the XML node
$node = $this->memberKey($member, $name);
if (isset($value->{$node})) {
$target[$name] = $this->dispatch($member, $value->{$node});
} else {
$memberShape = $shape->getMember($name);
if (!empty($memberShape['xmlAttribute'])) {
$target[$name] = $this->parse_xml_attribute(
$shape,
$memberShape,
$value
);
}
}
}
if (isset($shape['union'])
&& $shape['union']
&& empty($target)
) {
foreach ($value as $key => $val) {
$name = $val->children()->getName();
$target['Unknown'][$name] = $val->$name;
}
}
return $target;
}
private function memberKey(Shape $shape, $name)
{
// Check if locationName came from shape definition
if ($shape instanceof StructureShape && isset($shape['locationName'])) {
$originalDef = $shape->getOriginalDefinition($shape->getName());
if ($originalDef && isset($originalDef['locationName'])
&& $originalDef['locationName'] === $shape['locationName']
) {
return $name;
}
}
return $shape['locationName'] ?? $name;
}
private function parse_list(ListShape $shape, \SimpleXMLElement $value)
{
$target = [];
$member = $shape->getMember();
if (!$shape['flattened']) {
$value = $value->{$member['locationName'] ?: 'member'};
}
foreach ($value as $v) {
$target[] = $this->dispatch($member, $v);
}
return $target;
}
private function parse_map(MapShape $shape, \SimpleXMLElement $value)
{
$target = [];
if (!$shape['flattened']) {
$value = $value->entry;
}
$mapKey = $shape->getKey();
$mapValue = $shape->getValue();
$keyName = $shape->getKey()['locationName'] ?: 'key';
$valueName = $shape->getValue()['locationName'] ?: 'value';
foreach ($value as $node) {
$key = $this->dispatch($mapKey, $node->{$keyName});
$value = $this->dispatch($mapValue, $node->{$valueName});
$target[$key] = $value;
}
return $target;
}
private function parse_blob(Shape $shape, $value)
{
return base64_decode((string) $value);
}
private function parse_float(Shape $shape, $value)
{
$value = (string) $value;
return match ($value) {
'NaN', 'Infinity', '-Infinity' => $value,
default => (float) $value
};
}
private function parse_integer(Shape $shape, $value)
{
return (int) (string) $value;
}
private function parse_boolean(Shape $shape, $value)
{
return $value == 'true';
}
private function parse_timestamp(Shape $shape, $value)
{
if (is_string($value)
|| is_int($value)
|| (is_object($value)
&& method_exists($value, '__toString'))
) {
return DateTimeResult::fromTimestamp(
(string) $value,
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
);
}
throw new ParserException('Invalid timestamp value passed to XmlParser::parse_timestamp');
}
private function parse_xml_attribute(Shape $shape, Shape $memberShape, $value)
{
$namespace = $shape['xmlNamespace']['uri'] ?? '';
$prefix = $shape['xmlNamespace']['prefix'] ?? '';
if (!empty($prefix)) {
$prefix .= ':';
}
$key = str_replace($prefix, '', $memberShape['locationName']);
$attributes = $value->attributes($namespace);
return isset($attributes[$key]) ? (string) $attributes[$key] : null;
}
}

View file

@ -0,0 +1,38 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\Shape;
use Aws\Api\ListShape;
/**
* @internal
*/
class Ec2ParamBuilder extends QueryParamBuilder
{
protected function queryName(Shape $shape, $default = null)
{
return ($shape['queryName']
?: ucfirst(@$shape['locationName'] ?: ""))
?: $default;
}
protected function isFlat(Shape $shape)
{
return false;
}
protected function format_list(
ListShape $shape,
array $value,
$prefix,
&$query
) {
// Handle empty list serialization
if (!empty($value)) {
$items = $shape->getMember();
foreach ($value as $k => $v) {
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
}
}
}
}

View file

@ -0,0 +1,116 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\Service;
use Aws\Api\Shape;
use Aws\Api\TimestampShape;
use Aws\Exception\InvalidJsonException;
/**
* Formats the JSON body of a JSON-REST or JSON-RPC operation.
* @internal
*/
class JsonBody
{
private $api;
public function __construct(Service $api)
{
$this->api = $api;
}
/**
* Gets the JSON Content-Type header for a service API
*
* @param Service $service
*
* @return string
*/
public static function getContentType(Service $service)
{
if ($service->getMetadata('protocol') === 'rest-json') {
return 'application/json';
}
$jsonVersion = $service->getMetadata('jsonVersion');
if (empty($jsonVersion)) {
throw new \InvalidArgumentException('invalid json');
} else {
return 'application/x-amz-json-'
. @number_format($service->getMetadata('jsonVersion'), 1);
}
}
/**
* Builds the JSON body based on an array of arguments.
*
* @param Shape $shape Operation being constructed
* @param array|string $args Associative array of arguments, or a string.
*
* @return string
*/
public function build(Shape $shape, array|string $args)
{
try {
$result = json_encode($this->format($shape, $args), JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new InvalidJsonException(
'Unable to encode JSON document ' . $shape->getName() . ': ' .
$e->getMessage() . PHP_EOL
);
}
return $result === '[]' ? '{}' : $result;
}
private function format(Shape $shape, $value)
{
switch ($shape['type']) {
case 'structure':
$data = [];
if ($shape['document'] ?? false) {
return $value;
}
foreach ($value as $k => $v) {
if ($v !== null && $shape->hasMember($k)) {
$valueShape = $shape->getMember($k);
$data[$valueShape['locationName'] ?: $k]
= $this->format($valueShape, $v);
}
}
if (empty($data)) {
return new \stdClass;
}
return $data;
case 'list':
$items = $shape->getMember();
foreach ($value as $k => $v) {
$value[$k] = $this->format($items, $v);
}
return $value;
case 'map':
if (empty($value)) {
return new \stdClass;
}
$values = $shape->getValue();
foreach ($value as $k => $v) {
$value[$k] = $this->format($values, $v);
}
return $value;
case 'blob':
return base64_encode($value);
case 'timestamp':
$timestampFormat = !empty($shape['timestampFormat'])
? $shape['timestampFormat']
: 'unixTimestamp';
return TimestampShape::format($value, $timestampFormat);
default:
return $value;
}
}
}

View file

@ -0,0 +1,87 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\Service;
use Aws\CommandInterface;
use Aws\EndpointV2\EndpointV2SerializerTrait;
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
/**
* Prepares a JSON-RPC request for transfer.
* @internal
*/
class JsonRpcSerializer
{
use EndpointV2SerializerTrait;
/** @var JsonBody */
private $jsonFormatter;
/** @var string */
private $endpoint;
/** @var Service */
private $api;
/** @var string */
private $contentType;
/**
* @param Service $api Service description
* @param string $endpoint Endpoint to connect to
* @param JsonBody $jsonFormatter Optional JSON formatter to use
*/
public function __construct(
Service $api,
$endpoint,
?JsonBody $jsonFormatter = null
) {
$this->endpoint = $endpoint;
$this->api = $api;
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($this->api);
$this->contentType = JsonBody::getContentType($api);
}
/**
* When invoked with an AWS command, returns a serialization array
* containing "method", "uri", "headers", and "body" key value pairs.
*
* @param CommandInterface $command Command to serialize into a request.
* @param $endpointProvider Provider used for dynamic endpoint resolution.
* @param $clientArgs Client arguments used for dynamic endpoint resolution.
*
* @return RequestInterface
*/
public function __invoke(
CommandInterface $command,
$endpoint = null
)
{
$operationName = $command->getName();
$operation = $this->api->getOperation($operationName);
$commandArgs = $command->toArray();
$body = $this->jsonFormatter->build($operation->getInput(), $commandArgs);
$headers = [
'X-Amz-Target' => $this->api->getMetadata('targetPrefix') . '.' . $operationName,
'Content-Type' => $this->contentType,
'Content-Length' => strlen($body)
];
if ($endpoint instanceof RulesetEndpoint) {
$this->setEndpointV2RequestOptions($endpoint, $headers);
}
$requestUri = $operation['http']['requestUri'] ?? null;
$absoluteUri = str_ends_with($this->endpoint, '/')
? $this->endpoint : $this->endpoint . $requestUri;
return new Request(
$operation['http']['method'],
$absoluteUri,
$headers,
$body
);
}
}

View file

@ -0,0 +1,158 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\StructureShape;
use Aws\Api\ListShape;
use Aws\Api\MapShape;
use Aws\Api\Shape;
use Aws\Api\TimestampShape;
/**
* @internal
*/
class QueryParamBuilder
{
private $methods;
protected function queryName(Shape $shape, $default = null)
{
if (null !== $shape['queryName']) {
return $shape['queryName'];
}
if (null !== $shape['locationName']) {
return $shape['locationName'];
}
if ($this->isFlat($shape) && !empty($shape['member']['locationName'])) {
return $shape['member']['locationName'];
}
return $default;
}
protected function isFlat(Shape $shape)
{
return $shape['flattened'] === true;
}
public function __invoke(StructureShape $shape, array $params)
{
if (!$this->methods) {
$this->methods = array_fill_keys(get_class_methods($this), true);
}
$query = [];
$this->format_structure($shape, $params, '', $query);
return $query;
}
protected function format(Shape $shape, $value, $prefix, array &$query)
{
$type = 'format_' . $shape['type'];
if (isset($this->methods[$type])) {
$this->{$type}($shape, $value, $prefix, $query);
} else {
$query[$prefix] = (string) $value;
}
}
protected function format_structure(
StructureShape $shape,
array $value,
$prefix,
&$query
) {
if ($prefix) {
$prefix .= '.';
}
foreach ($value as $k => $v) {
if ($shape->hasMember($k)) {
$member = $shape->getMember($k);
$this->format(
$member,
$v,
$prefix . $this->queryName($member, $k),
$query
);
}
}
}
protected function format_list(
ListShape $shape,
array $value,
$prefix,
&$query
) {
// Handle empty list serialization
if (!$value) {
$query[$prefix] = '';
return;
}
$items = $shape->getMember();
if (!$this->isFlat($shape)) {
$locationName = $shape->getMember()['locationName'] ?: 'member';
$prefix .= ".$locationName";
// flattened lists can also model a `locationName`
} elseif ($name = $shape['locationName'] ?? $this->queryName($items)) {
$parts = explode('.', $prefix);
$parts[count($parts) - 1] = $name;
$prefix = implode('.', $parts);
}
foreach ($value as $k => $v) {
$this->format($items, $v, $prefix . '.' . ($k + 1), $query);
}
}
protected function format_map(
MapShape $shape,
array $value,
$prefix,
array &$query
) {
$vals = $shape->getValue();
$keys = $shape->getKey();
if (!$this->isFlat($shape)) {
$prefix .= '.entry';
}
$i = 0;
$keyName = '%s.%d.' . $this->queryName($keys, 'key');
$valueName = '%s.%s.' . $this->queryName($vals, 'value');
foreach ($value as $k => $v) {
$i++;
$this->format($keys, $k, sprintf($keyName, $prefix, $i), $query);
$this->format($vals, $v, sprintf($valueName, $prefix, $i), $query);
}
}
protected function format_blob(Shape $shape, $value, $prefix, array &$query)
{
$query[$prefix] = base64_encode($value);
}
protected function format_timestamp(
TimestampShape $shape,
$value,
$prefix,
array &$query
) {
$timestampFormat = !empty($shape['timestampFormat'])
? $shape['timestampFormat']
: 'iso8601';
$query[$prefix] = TimestampShape::format($value, $timestampFormat);
}
protected function format_boolean(Shape $shape, $value, $prefix, array &$query)
{
$query[$prefix] = ($value) ? 'true' : 'false';
}
}

View file

@ -0,0 +1,82 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\Service;
use Aws\CommandInterface;
use Aws\EndpointV2\EndpointProviderV2;
use Aws\EndpointV2\EndpointV2SerializerTrait;
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
/**
* Serializes a query protocol request.
* @internal
*/
class QuerySerializer
{
use EndpointV2SerializerTrait;
private $endpoint;
private $api;
private $paramBuilder;
public function __construct(
Service $api,
$endpoint,
?callable $paramBuilder = null
) {
$this->api = $api;
$this->endpoint = $endpoint;
$this->paramBuilder = $paramBuilder ?: new QueryParamBuilder();
}
/**
* When invoked with an AWS command, returns a serialization array
* containing "method", "uri", "headers", and "body" key value pairs.
*
* @param CommandInterface $command Command to serialize into a request.
* @param null $endpoint Endpoint resolved using EndpointProviderV2
* @return RequestInterface
*/
public function __invoke(
CommandInterface $command,
$endpoint = null
)
{
$operation = $this->api->getOperation($command->getName());
$body = [
'Action' => $command->getName(),
'Version' => $this->api->getMetadata('apiVersion')
];
$commandArgs = $command->toArray();
// Only build up the parameters when there are parameters to build
if ($commandArgs) {
$body += call_user_func(
$this->paramBuilder,
$operation->getInput(),
$commandArgs
);
}
$body = http_build_query($body, '', '&', PHP_QUERY_RFC3986);
$headers = [
'Content-Length' => strlen($body),
'Content-Type' => 'application/x-www-form-urlencoded'
];
$requestUri = $operation['http']['requestUri'] ?? null;
if ($endpoint instanceof RulesetEndpoint) {
$this->setEndpointV2RequestOptions($endpoint, $headers);
}
$absoluteUri = str_ends_with($this->endpoint, '/')
? $this->endpoint : $this->endpoint . $requestUri;
return new Request(
'POST',
$absoluteUri,
$headers,
$body
);
}
}

View file

@ -0,0 +1,41 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\Service;
use Aws\Api\StructureShape;
/**
* Serializes requests for the REST-JSON protocol.
* @internal
*/
class RestJsonSerializer extends RestSerializer
{
/** @var JsonBody */
private $jsonFormatter;
/** @var string */
private $contentType;
/**
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
* @param JsonBody $jsonFormatter Optional JSON formatter to use
*/
public function __construct(
Service $api,
$endpoint,
?JsonBody $jsonFormatter = null
) {
parent::__construct($api, $endpoint);
$this->contentType = JsonBody::getContentType($api);
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($api);
}
protected function payload(StructureShape $member, array|string $value, array &$opts)
{
$opts['headers']['Content-Type'] = $this->contentType;
$body = $this->jsonFormatter->build($member, $value);
$opts['headers']['Content-Length'] = strlen($body);
$opts['body'] = $body;
}
}

View file

@ -0,0 +1,486 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\ListShape;
use Aws\Api\MapShape;
use Aws\Api\Service;
use Aws\Api\Operation;
use Aws\Api\Shape;
use Aws\Api\StructureShape;
use Aws\Api\TimestampShape;
use Aws\CommandInterface;
use Aws\EndpointV2\EndpointV2SerializerTrait;
use Aws\EndpointV2\Ruleset\RulesetEndpoint;
use DateTimeInterface;
use GuzzleHttp\Psr7;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Uri;
use GuzzleHttp\Psr7\UriResolver;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\UriInterface;
/**
* Serializes HTTP locations like header, uri, payload, etc...
* @internal
*/
abstract class RestSerializer
{
private const TEMPLATE_STRING_REGEX = '/\{([^\}]+)\}/';
private static array $excludeContentType = [
's3' => true,
'glacier' => true
];
/** @var Service */
private Service $api;
/** @var Uri */
private $endpoint;
/** @var bool */
private $isUseEndpointV2;
use EndpointV2SerializerTrait;
/**
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
*/
public function __construct(Service $api, $endpoint)
{
$this->api = $api;
$this->endpoint = Psr7\Utils::uriFor($endpoint);
}
/**
* @param CommandInterface $command Command to serialize into a request.
* @param mixed|null $endpoint
* @return RequestInterface
*/
public function __invoke(
CommandInterface $command,
mixed $endpoint = null
)
{
$operation = $this->api->getOperation($command->getName());
$commandArgs = $command->toArray();
$opts = $this->serialize($operation, $commandArgs);
$headers = $opts['headers'] ?? [];
if ($endpoint instanceof RulesetEndpoint) {
$this->isUseEndpointV2 = true;
$this->setEndpointV2RequestOptions($endpoint, $headers);
}
$uri = $this->buildEndpoint($operation, $commandArgs, $opts);
return new Request(
$operation['http']['method'],
$uri,
$headers,
$opts['body'] ?? null
);
}
/**
* Modifies a hash of request options for a payload body.
*
* @param StructureShape $member Member to serialize
* @param array $value Value to serialize
* @param array $opts Request options to modify.
*/
abstract protected function payload(
StructureShape $member,
array $value,
array &$opts
);
private function serialize(Operation $operation, array $args)
{
$opts = [];
$input = $operation->getInput();
// Apply the payload trait if present
if ($payload = $input['payload']) {
$this->applyPayload($input, $payload, $args, $opts);
}
foreach ($args as $name => $value) {
if ($input->hasMember($name)) {
$member = $input->getMember($name);
$location = $member['location'];
if (!$payload && !$location) {
$bodyMembers[$name] = $value;
} elseif ($location === 'header') {
$this->applyHeader($name, $member, $value, $opts);
} elseif ($location === 'querystring') {
$this->applyQuery($name, $member, $value, $opts);
} elseif ($location === 'headers') {
$this->applyHeaderMap($name, $member, $value, $opts);
}
}
}
if (isset($bodyMembers)) {
$this->payload($input, $bodyMembers, $opts);
} else if (!isset($opts['body']) && $this->hasPayloadParam($input, $payload)) {
$this->payload($input, [], $opts);
}
return $opts;
}
private function applyPayload(StructureShape $input, $name, array $args, array &$opts)
{
if (!isset($args[$name])) {
return;
}
$m = $input->getMember($name);
$type = $m->getType();
if ($m['streaming'] ||
($type === 'string' || $type === 'blob')
) {
// This path skips setting the content-type header usually done in
// RestJsonSerializer and RestXmlSerializer.certain S3 and glacier
// operations determine content type in Middleware::ContentType()
if (!isset(self::$excludeContentType[$this->api->getServiceName()])) {
switch ($type) {
case 'string':
$opts['headers']['Content-Type'] = 'text/plain';
break;
case 'blob':
$opts['headers']['Content-Type'] = 'application/octet-stream';
break;
}
}
$body = $args[$name];
if (!$m['streaming'] && is_string($body)) {
$opts['headers']['Content-Length'] = strlen($body);
}
// Streaming bodies or payloads that are strings are
// always just a stream of data.
$opts['body'] = Psr7\Utils::streamFor($body);
return;
}
$this->payload($m, $args[$name], $opts);
}
private function applyHeader($name, Shape $member, $value, array &$opts)
{
// Handle lists by recursively applying header logic to each element
if ($member instanceof ListShape) {
$listMember = $member->getMember();
$headerValues = [];
foreach ($value as $listValue) {
$tempOpts = ['headers' => []];
$this->applyHeader('temp', $listMember, $listValue, $tempOpts);
$convertedValue = $tempOpts['headers']['temp'];
$headerValues[] = $convertedValue;
}
$value = $headerValues;
} elseif (!is_null($value)) {
switch ($member->getType()) {
case 'timestamp':
$timestampFormat = $member['timestampFormat'] ?? 'rfc822';
$value = $this->formatTimestamp($value, $timestampFormat);
break;
case 'boolean':
$value = $this->formatBoolean($value);
break;
}
}
if ($member['jsonvalue']) {
$value = json_encode($value);
if (empty($value) && JSON_ERROR_NONE !== json_last_error()) {
throw new \InvalidArgumentException('Unable to encode the provided value'
. ' with \'json_encode\'. ' . json_last_error_msg());
}
$value = base64_encode($value);
}
$opts['headers'][$member['locationName'] ?: $name] = $value;
}
/**
* Note: This is currently only present in the Amazon S3 model.
*/
private function applyHeaderMap($name, Shape $member, array $value, array &$opts)
{
$prefix = $member['locationName'];
foreach ($value as $k => $v) {
$opts['headers'][$prefix . $k] = $v;
}
}
private function applyQuery($name, Shape $member, $value, array &$opts)
{
if ($member instanceof MapShape) {
$opts['query'] = isset($opts['query']) && is_array($opts['query'])
? $opts['query'] + $value
: $value;
} elseif ($member instanceof ListShape) {
$listMember = $member->getMember();
$paramName = $member['locationName'] ?: $name;
foreach ($value as $listValue) {
// Recursively call applyQuery for each list element
$tempOpts = ['query' => []];
$this->applyQuery('temp', $listMember, $listValue, $tempOpts);
$opts['query'][$paramName][] = $tempOpts['query']['temp'];
}
} elseif (!is_null($value)) {
switch ($member->getType()) {
case 'timestamp':
$timestampFormat = $member['timestampFormat'] ?? 'iso8601';
$value = $this->formatTimestamp($value, $timestampFormat);
break;
case 'boolean':
$value = $this->formatBoolean($value);
break;
}
$opts['query'][$member['locationName'] ?: $name] = $value;
}
}
private function buildEndpoint(
Operation $operation,
array $args,
array $opts
): UriInterface
{
// Expand `requestUri` field members
$relativeUri = $this->expandUriTemplate($operation, $args);
// Add query members to relativeUri
if (!empty($opts['query'])) {
$relativeUri = $this->appendQuery($opts['query'], $relativeUri);
}
// Special case - S3 keys that need path preservation
if ($this->api->getServiceName() === 's3'
&& isset($args['Key'])
&& $this->shouldPreservePath($args['Key'])
) {
return new Uri($this->endpoint . $relativeUri);
}
return $this->resolveUri($relativeUri, $opts);
}
/**
* Expands `requestUri` members
*
* @param Operation $operation
* @param array $args
*
* @return string
*/
private function expandUriTemplate(Operation $operation, array $args): string
{
$varDefinitions = $this->getVarDefinitions($operation, $args);
return preg_replace_callback(
self::TEMPLATE_STRING_REGEX,
static function (array $matches) use ($varDefinitions) {
$isGreedy = str_ends_with($matches[1], '+');
$varName = $isGreedy ? substr($matches[1], 0, -1) : $matches[1];
if (!isset($varDefinitions[$varName])) {
return '';
}
$value = $varDefinitions[$varName];
if ($isGreedy) {
return str_replace('%2F', '/', rawurlencode($value));
}
return rawurlencode($value);
},
$operation['http']['requestUri']
);
}
/**
* Checks for path-like key names. If detected, traditional
* URI resolution is bypassed.
*
* @param string $key
* @return bool
*/
private function shouldPreservePath(string $key): bool
{
// Keys with dot segments
if (str_contains($key, '.')) {
$segments = explode('/', $key);
foreach ($segments as $segment) {
if ($segment === '.' || $segment === '..') {
return true;
}
}
}
// Keys starting with slash
if (str_starts_with($key, '/')) {
return true;
}
return false;
}
/**
* @param string $relativeUri
* @param array $opts
*
* @return UriInterface
*/
private function resolveUri(string $relativeUri, array $opts): UriInterface
{
$basePath = $this->endpoint->getPath();
// Only process if we have a non-empty base path
if (!empty($basePath) && $basePath !== '/') {
// if relative is just '/', we want just the base path without trailing slash
if ($relativeUri === '/' || empty($relativeUri)) {
// Remove trailing slash if present
return $this->endpoint->withPath(rtrim($basePath, '/'));
}
// if relative is '/?query', we want base path without trailing slash + query
// for now, this is only seen with S3 GetBucketLocation after processing the model
if (empty($opts['query'])
&& str_starts_with($relativeUri, '/?')
) {
$query = substr($relativeUri, 2); // Remove '/?'
return $this->endpoint->withQuery($query);
}
// Ensure base path has trailing slash
if (!str_ends_with($basePath, '/')) {
$this->endpoint = $this->endpoint->withPath($basePath . '/');
}
// Remove leading slash from relative path to make it relative
if (str_starts_with($relativeUri, '/')) {
$relativeUri = substr($relativeUri, 1);
}
}
return UriResolver::resolve($this->endpoint, new Uri($relativeUri));
}
/**
* @param StructureShape $input
* @param $payload
*
* @return bool
*/
private function hasPayloadParam(StructureShape $input, $payload)
{
if ($payload) {
$potentiallyEmptyTypes = ['blob','string'];
if ($this->api->getProtocol() === 'rest-xml') {
$potentiallyEmptyTypes[] = 'structure';
}
$payloadMember = $input->getMember($payload);
//unions may also be empty/unset
if (!empty($payloadMember['union'])
|| in_array($payloadMember['type'], $potentiallyEmptyTypes)
) {
return false;
}
}
foreach ($input->getMembers() as $member) {
if (!isset($member['location'])) {
return true;
}
}
return false;
}
/**
* @param $query
* @param $relativeUri
*
* @return string
*/
private function appendQuery($query, $relativeUri): string
{
$append = Psr7\Query::build($query);
return $relativeUri
. (str_contains($relativeUri, '?') ? "&{$append}" : "?{$append}");
}
/**
* @param CommandInterface $command
* @param array $args
*
* @return array
*/
private function getVarDefinitions(
Operation $operation,
array $args
): array
{
$varDefinitions = [];
foreach ($operation->getInput()->getMembers() as $name => $member) {
if ($member['location'] === 'uri') {
$value = $args[$name] ?? null;
if (!is_null($value)) {
switch ($member->getType()) {
case 'timestamp':
$timestampFormat = $member['timestampFormat'] ?? 'iso8601';
$value = $this->formatTimestamp($value, $timestampFormat);
break;
case 'boolean':
$value = $this->formatBoolean($value);
break;
}
}
$varDefinitions[$member['locationName'] ?: $name] = $value;
}
}
return $varDefinitions;
}
/**
* @param DateTimeInterface|string|int $value
* @param string $timestampFormat
*
* @return string
*/
private function formatTimestamp(
DateTimeInterface|string|int $value,
string $timestampFormat
): string
{
return TimestampShape::format($value, $timestampFormat);
}
/**
* @param $value
*
* @return string
*/
private function formatBoolean($value): string
{
return $value ? 'true' : 'false';
}
}

View file

@ -0,0 +1,50 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\StructureShape;
use Aws\Api\Service;
/**
* @internal
*/
class RestXmlSerializer extends RestSerializer
{
/** @var XmlBody */
private $xmlBody;
/**
* @param Service $api Service API description
* @param string $endpoint Endpoint to connect to
* @param XmlBody $xmlBody Optional XML formatter to use
*/
public function __construct(
Service $api,
$endpoint,
?XmlBody $xmlBody = null
) {
parent::__construct($api, $endpoint);
$this->xmlBody = $xmlBody ?: new XmlBody($api);
}
protected function payload(StructureShape $member, array $value, array &$opts)
{
$opts['headers']['Content-Type'] = 'application/xml';
$body = $this->getXmlBody($member, $value);
$opts['headers']['Content-Length'] = strlen($body);
$opts['body'] = $body;
}
/**
* @param StructureShape $member
* @param array $value
* @return string
*/
private function getXmlBody(StructureShape $member, array $value)
{
$xmlBody = (string)$this->xmlBody->build($member, $value);
$xmlBody = str_replace("'", "&apos;", $xmlBody);
$xmlBody = str_replace('\r', "&#13;", $xmlBody);
$xmlBody = str_replace('\n', "&#10;", $xmlBody);
return $xmlBody;
}
}

View file

@ -0,0 +1,256 @@
<?php
namespace Aws\Api\Serializer;
use Aws\Api\MapShape;
use Aws\Api\Service;
use Aws\Api\Shape;
use Aws\Api\StructureShape;
use Aws\Api\ListShape;
use Aws\Api\TimestampShape;
use XMLWriter;
/**
* @internal Formats the XML body of a REST-XML services.
*/
class XmlBody
{
/** @var Service */
private Service $api;
/**
* @param Service $api API being used to create the XML body.
*/
public function __construct(Service $api)
{
$this->api = $api;
}
/**
* Builds the XML body based on an array of arguments.
*
* @param Shape $shape Operation being constructed
* @param array $args Associative array of arguments
*
* @return string
*/
public function build(Shape $shape, array $args)
{
$xml = new XMLWriter();
$xml->openMemory();
$xml->startDocument('1.0', 'UTF-8');
$rootElementName = $this->determineRootElementName($shape);
$this->format($shape, $rootElementName, $args, $xml);
$xml->endDocument();
return $xml->outputMemory();
}
private function startElement(Shape $shape, $name, XMLWriter $xml)
{
$xml->startElement($name);
if ($ns = $shape['xmlNamespace']) {
$xml->writeAttribute(
isset($ns['prefix']) ? "xmlns:{$ns['prefix']}" : 'xmlns',
$ns['uri']
);
}
}
private function format(Shape $shape, $name, $value, XMLWriter $xml)
{
// Any method mentioned here has a custom serialization handler.
static $methods = [
'add_structure' => true,
'add_list' => true,
'add_blob' => true,
'add_timestamp' => true,
'add_boolean' => true,
'add_map' => true,
'add_string' => true
];
$type = 'add_' . $shape['type'];
if (isset($methods[$type])) {
$this->{$type}($shape, $name, $value, $xml);
} else {
$this->defaultShape($shape, $name, $value, $xml);
}
}
private function defaultShape(Shape $shape, $name, $value, XMLWriter $xml)
{
$this->startElement($shape, $name, $xml);
$xml->text($value);
$xml->endElement();
}
private function add_structure(
StructureShape $shape,
$name,
array $value,
\XMLWriter $xml
) {
$this->startElement($shape, $name, $xml);
foreach ($this->getStructureMembers($shape, $value) as $k => $definition) {
// Default to member name
$elementName = $k;
// Only use locationName for non-structure members
if (!($definition['member'] instanceof StructureShape)
&& $definition['member']['locationName']
) {
$elementName = $definition['member']['locationName'];
}
$this->format(
$definition['member'],
$elementName,
$definition['value'],
$xml
);
}
$xml->endElement();
}
private function getStructureMembers(StructureShape $shape, array $value)
{
$members = [];
foreach ($value as $k => $v) {
if ($v !== null && $shape->hasMember($k)) {
$definition = [
'member' => $shape->getMember($k),
'value' => $v,
];
if ($definition['member']['xmlAttribute']) {
// array_unshift_associative
$members = [$k => $definition] + $members;
} else {
$members[$k] = $definition;
}
}
}
return $members;
}
private function add_list(
ListShape $shape,
$name,
array $value,
XMLWriter $xml
) {
$items = $shape->getMember();
if ($shape['flattened']) {
$elementName = $name;
} else {
$this->startElement($shape, $name, $xml);
$elementName = $items['locationName'] ?: 'member';
}
foreach ($value as $v) {
$this->format($items, $elementName, $v, $xml);
}
if (!$shape['flattened']) {
$xml->endElement();
}
}
private function add_map(
MapShape $shape,
$name,
array $value,
XMLWriter $xml
) {
$xmlEntry = $shape['flattened'] ? $name : 'entry';
$xmlKey = $shape->getKey()['locationName'] ?: 'key';
$xmlValue = $shape->getValue()['locationName'] ?: 'value';
if (!$shape['flattened']) {
$this->startElement($shape, $name, $xml);
}
foreach ($value as $key => $v) {
$this->startElement($shape, $xmlEntry, $xml);
$this->format($shape->getKey(), $xmlKey, $key, $xml);
$this->format($shape->getValue(), $xmlValue, $v, $xml);
$xml->endElement();
}
if (!$shape['flattened']) {
$xml->endElement();
}
}
private function add_blob(Shape $shape, $name, $value, XMLWriter $xml)
{
$this->startElement($shape, $name, $xml);
$xml->writeRaw(base64_encode($value));
$xml->endElement();
}
private function add_timestamp(
TimestampShape $shape,
$name,
$value,
XMLWriter $xml
) {
$this->startElement($shape, $name, $xml);
$timestampFormat = !empty($shape['timestampFormat'])
? $shape['timestampFormat']
: 'iso8601';
$xml->writeRaw(TimestampShape::format($value, $timestampFormat));
$xml->endElement();
}
private function add_boolean(
Shape $shape,
$name,
$value,
XMLWriter $xml
) {
$this->startElement($shape, $name, $xml);
$xml->writeRaw($value ? 'true' : 'false');
$xml->endElement();
}
private function add_string(
Shape $shape,
$name,
$value,
XMLWriter $xml
) {
if ($shape['xmlAttribute']) {
$xml->writeAttribute($shape['locationName'] ?: $name, $value);
} else {
$this->defaultShape($shape, $name, $value, $xml);
}
}
private function determineRootElementName(Shape $shape): string
{
$shapeName = $shape->getName();
// Look up the shape definition first
if ($shapeName && $shapeMap = $shape->getShapeMap()) {
if (isset($shapeMap[$shapeName]['locationName'])) {
return $shapeMap[$shapeName]['locationName'];
}
}
// Fall back to shape's current locationName
if ($shape['locationName']) {
return $shape['locationName'];
}
return $shapeName;
}
}

View file

@ -0,0 +1,564 @@
<?php
namespace Aws\Api;
/**
* Represents a web service API model.
*/
class Service extends AbstractModel
{
/** @var callable */
private $apiProvider;
/** @var string */
private $serviceName;
/** @var string */
private $apiVersion;
/** @var array */
private $clientContextParams = [];
/** @var Operation[] */
private $operations = [];
/** @var array */
private $paginators = null;
/** @var array */
private $waiters = null;
/** @var boolean */
private $modifiedModel = false;
/** @var string */
private $protocol;
/**
* @param array $definition
* @param callable $provider
*
* @internal param array $definition Service description
*/
public function __construct(array $definition, callable $provider)
{
static $defaults = [
'operations' => [],
'shapes' => [],
'metadata' => [],
'clientContextParams' => []
], $defaultMeta = [
'apiVersion' => null,
'serviceFullName' => null,
'serviceId' => null,
'endpointPrefix' => null,
'signingName' => null,
'signatureVersion' => null,
'protocol' => null,
'uid' => null
];
$definition += $defaults;
$definition['metadata'] += $defaultMeta;
$this->definition = $definition;
$this->apiProvider = $provider;
parent::__construct($definition, new ShapeMap($definition['shapes']));
if (isset($definition['metadata']['serviceIdentifier'])) {
$this->serviceName = $this->getServiceName();
} else {
$this->serviceName = $this->getEndpointPrefix();
}
$this->apiVersion = $this->getApiVersion();
if (isset($definition['clientContextParams'])) {
$this->clientContextParams = $definition['clientContextParams'];
}
$this->protocol = $this->selectProtocol($definition);
}
/**
* Creates a request serializer for the provided API object.
*
* @param Service $api API that contains a protocol.
* @param string $endpoint Endpoint to send requests to.
*
* @return callable
* @throws \UnexpectedValueException
*/
public static function createSerializer(Service $api, $endpoint)
{
static $mapping = [
'json' => Serializer\JsonRpcSerializer::class,
'query' => Serializer\QuerySerializer::class,
'rest-json' => Serializer\RestJsonSerializer::class,
'rest-xml' => Serializer\RestXmlSerializer::class
];
$proto = $api->getProtocol();
if (isset($mapping[$proto])) {
return new $mapping[$proto]($api, $endpoint);
}
if ($proto == 'ec2') {
return new Serializer\QuerySerializer($api, $endpoint, new Serializer\Ec2ParamBuilder());
}
throw new \UnexpectedValueException(
'Unknown protocol: ' . $api->getProtocol()
);
}
/**
* Creates an error parser for the given protocol.
*
* Redundant method signature to preserve backwards compatibility.
*
* @param string $protocol Protocol to parse (e.g., query, json, etc.)
*
* @return callable
* @throws \UnexpectedValueException
*/
public static function createErrorParser($protocol, ?Service $api = null)
{
static $mapping = [
'json' => ErrorParser\JsonRpcErrorParser::class,
'query' => ErrorParser\XmlErrorParser::class,
'rest-json' => ErrorParser\RestJsonErrorParser::class,
'rest-xml' => ErrorParser\XmlErrorParser::class,
'ec2' => ErrorParser\XmlErrorParser::class
];
if (isset($mapping[$protocol])) {
return new $mapping[$protocol]($api);
}
throw new \UnexpectedValueException("Unknown protocol: $protocol");
}
/**
* Applies the listeners needed to parse client models.
*
* @param Service $api API to create a parser for
* @return callable
* @throws \UnexpectedValueException
*/
public static function createParser(Service $api)
{
static $mapping = [
'json' => Parser\JsonRpcParser::class,
'query' => Parser\QueryParser::class,
'rest-json' => Parser\RestJsonParser::class,
'rest-xml' => Parser\RestXmlParser::class
];
$proto = $api->getProtocol();
if (isset($mapping[$proto])) {
return new $mapping[$proto]($api);
}
if ($proto == 'ec2') {
return new Parser\QueryParser($api, null, false);
}
throw new \UnexpectedValueException(
'Unknown protocol: ' . $api->getProtocol()
);
}
/**
* Get the full name of the service
*
* @return string
*/
public function getServiceFullName()
{
return $this->definition['metadata']['serviceFullName'];
}
/**
* Get the service id
*
* @return string
*/
public function getServiceId()
{
return $this->definition['metadata']['serviceId'];
}
/**
* Get the API version of the service
*
* @return string
*/
public function getApiVersion()
{
return $this->definition['metadata']['apiVersion'];
}
/**
* Get the API version of the service
*
* @return string
*/
public function getEndpointPrefix()
{
return $this->definition['metadata']['endpointPrefix'];
}
/**
* Get the signing name used by the service.
*
* @return string
*/
public function getSigningName()
{
return $this->definition['metadata']['signingName']
?: $this->definition['metadata']['endpointPrefix'];
}
/**
* Get the service name.
*
* @return string
*/
public function getServiceName()
{
return $this->definition['metadata']['serviceIdentifier'] ?? null;
}
/**
* Get the default signature version of the service.
*
* Note: this method assumes "v4" when not specified in the model.
*
* @return string
*/
public function getSignatureVersion()
{
return $this->definition['metadata']['signatureVersion'] ?: 'v4';
}
/**
* Get the protocol used by the service.
*
* @return string
*/
public function getProtocol()
{
return $this->protocol;
}
/**
* Get the uid string used by the service
*
* @return string
*/
public function getUid()
{
return $this->definition['metadata']['uid'];
}
/**
* Check if the description has a specific operation by name.
*
* @param string $name Operation to check by name
*
* @return bool
*/
public function hasOperation($name)
{
return isset($this['operations'][$name]);
}
/**
* Get an operation by name.
*
* @param string $name Operation to retrieve by name
*
* @return Operation
* @throws \InvalidArgumentException If the operation is not found
*/
public function getOperation($name)
{
if (!isset($this->operations[$name])) {
if (!isset($this->definition['operations'][$name])) {
throw new \InvalidArgumentException("Unknown operation: $name");
}
$this->operations[$name] = new Operation(
$this->definition['operations'][$name],
$this->shapeMap
);
} elseif ($this->modifiedModel) {
$this->operations[$name] = new Operation(
$this->definition['operations'][$name],
$this->shapeMap
);
}
return $this->operations[$name];
}
/**
* Get all of the operations of the description.
*
* @return Operation[]
*/
public function getOperations()
{
$result = [];
foreach ($this->definition['operations'] as $name => $definition) {
$result[$name] = $this->getOperation($name);
}
return $result;
}
/**
* Get all of the error shapes of the service
*
* @return array
*/
public function getErrorShapes()
{
$result = [];
foreach ($this->definition['shapes'] as $name => $definition) {
if (!empty($definition['exception'])) {
$definition['name'] = $name;
$result[] = new StructureShape($definition, $this->getShapeMap());
}
}
return $result;
}
/**
* Get all of the service metadata or a specific metadata key value.
*
* @param string|null $key Key to retrieve or null to retrieve all metadata
*
* @return mixed Returns the result or null if the key is not found
*/
public function getMetadata($key = null)
{
if (!$key) {
return $this['metadata'];
}
if (isset($this->definition['metadata'][$key])) {
return $this->definition['metadata'][$key];
}
return null;
}
/**
* Gets an associative array of available paginator configurations where
* the key is the name of the paginator, and the value is the paginator
* configuration.
*
* @return array
* @unstable The configuration format of paginators may change in the future
*/
public function getPaginators()
{
if (!isset($this->paginators)) {
$res = call_user_func(
$this->apiProvider,
'paginator',
$this->serviceName,
$this->apiVersion
);
$this->paginators = isset($res['pagination'])
? $res['pagination']
: [];
}
return $this->paginators;
}
/**
* Determines if the service has a paginator by name.
*
* @param string $name Name of the paginator.
*
* @return bool
*/
public function hasPaginator($name)
{
return isset($this->getPaginators()[$name]);
}
/**
* Retrieve a paginator by name.
*
* @param string $name Paginator to retrieve by name. This argument is
* typically the operation name.
* @return array
* @throws \UnexpectedValueException if the paginator does not exist.
* @unstable The configuration format of paginators may change in the future
*/
public function getPaginatorConfig($name)
{
static $defaults = [
'input_token' => null,
'output_token' => null,
'limit_key' => null,
'result_key' => null,
'more_results' => null,
];
if ($this->hasPaginator($name)) {
return $this->paginators[$name] + $defaults;
}
throw new \UnexpectedValueException("There is no {$name} "
. "paginator defined for the {$this->serviceName} service.");
}
/**
* Gets an associative array of available waiter configurations where the
* key is the name of the waiter, and the value is the waiter
* configuration.
*
* @return array
*/
public function getWaiters()
{
if (!isset($this->waiters)) {
$res = call_user_func(
$this->apiProvider,
'waiter',
$this->serviceName,
$this->apiVersion
);
$this->waiters = isset($res['waiters'])
? $res['waiters']
: [];
}
return $this->waiters;
}
/**
* Determines if the service has a waiter by name.
*
* @param string $name Name of the waiter.
*
* @return bool
*/
public function hasWaiter($name)
{
return isset($this->getWaiters()[$name]);
}
/**
* Get a waiter configuration by name.
*
* @param string $name Name of the waiter by name.
*
* @return array
* @throws \UnexpectedValueException if the waiter does not exist.
*/
public function getWaiterConfig($name)
{
// Error if the waiter is not defined
if ($this->hasWaiter($name)) {
return $this->waiters[$name];
}
throw new \UnexpectedValueException("There is no {$name} waiter "
. "defined for the {$this->serviceName} service.");
}
/**
* Get the shape map used by the API.
*
* @return ShapeMap
*/
public function getShapeMap()
{
return $this->shapeMap;
}
/**
* Get all the context params of the description.
*
* @return array
*/
public function getClientContextParams()
{
return $this->clientContextParams;
}
/**
* Get the service's api provider.
*
* @return callable
*/
public function getProvider()
{
return $this->apiProvider;
}
/**
* Get the service's definition.
*
* @return callable
*/
public function getDefinition()
{
return $this->definition;
}
/**
* Sets the service's api definition.
* Intended for internal use only.
*
* @return void
*
* @internal
*/
public function setDefinition($definition)
{
$this->definition = $definition;
$this->shapeMap = new ShapeMap($definition['shapes']);
$this->modifiedModel = true;
}
/**
* Denotes whether or not a service's definition has
* been modified. Intended for internal use only.
*
* @return bool
*
* @internal
*/
public function isModifiedModel()
{
return $this->modifiedModel;
}
/**
* Accepts a list of protocols derived from the service model.
* Returns the highest priority compatible auth scheme if the `protocols` trait is present.
* Otherwise, returns the value of the `protocol` field, if set, or null.
*
* @param array $definition
*
* @return string|null
*/
private function selectProtocol(array $definition): string | null
{
$modeledProtocols = $definition['metadata']['protocols'] ?? null;
if (!empty($modeledProtocols)) {
foreach(SupportedProtocols::cases() as $protocol) {
if (in_array($protocol->value, $modeledProtocols)) {
return $protocol->value;
}
}
}
return $definition['metadata']['protocol'] ?? null;
}
}

View file

@ -0,0 +1,77 @@
<?php
namespace Aws\Api;
/**
* Base class representing a modeled shape.
*/
class Shape extends AbstractModel
{
/**
* Get a concrete shape for the given definition.
*
* @param array $definition
* @param ShapeMap $shapeMap
*
* @return mixed
* @throws \RuntimeException if the type is invalid
*/
public static function create(array $definition, ShapeMap $shapeMap)
{
static $map = [
'structure' => StructureShape::class,
'map' => MapShape::class,
'list' => ListShape::class,
'timestamp' => TimestampShape::class,
'integer' => Shape::class,
'double' => Shape::class,
'float' => Shape::class,
'long' => Shape::class,
'string' => Shape::class,
'byte' => Shape::class,
'character' => Shape::class,
'blob' => Shape::class,
'boolean' => Shape::class
];
if (isset($definition['shape'])) {
return $shapeMap->resolve($definition);
}
if (!isset($map[$definition['type']])) {
throw new \RuntimeException('Invalid type: '
. print_r($definition, true));
}
$type = $map[$definition['type']];
return new $type($definition, $shapeMap);
}
/**
* Get the type of the shape
*
* @return string
*/
public function getType()
{
return $this->definition['type'];
}
/**
* Get the name of the shape
*
* @return string
*/
public function getName()
{
return $this->definition['name'];
}
/**
* Get a context param definition.
*/
public function getContextParam()
{
return $this->contextParam;
}
}

View file

@ -0,0 +1,109 @@
<?php
namespace Aws\Api;
/**
* Builds shape based on shape references.
*/
class ShapeMap implements \ArrayAccess
{
/** @var array */
private $definitions;
/** @var Shape[] */
private $simple;
/**
* @param array $shapeModels Associative array of shape definitions.
*/
public function __construct(array $shapeModels)
{
$this->definitions = $shapeModels;
}
/**
* Get an array of shape names.
*
* @return array
*/
public function getShapeNames()
{
return array_keys($this->definitions);
}
/**
* Resolve a shape reference
*
* @param array $shapeRef Shape reference shape
*
* @return Shape
* @throws \InvalidArgumentException
*/
public function resolve(array $shapeRef)
{
$shape = $shapeRef['shape'];
if (!isset($this->definitions[$shape])) {
throw new \InvalidArgumentException('Shape not found: ' . $shape);
}
$isSimple = count($shapeRef) == 1;
if ($isSimple && isset($this->simple[$shape])) {
return $this->simple[$shape];
}
$definition = $shapeRef + $this->definitions[$shape];
$definition['name'] = $definition['shape'];
if (isset($definition['shape'])) {
unset($definition['shape']);
}
$result = Shape::create($definition, $this);
if ($isSimple) {
$this->simple[$shape] = $result;
}
return $result;
}
/**
* @param mixed $offset
* @return bool
*/
public function offsetExists(mixed $offset): bool
{
return isset($this->definitions[$offset]);
}
/**
* @param mixed $offset
* @return mixed
*/
public function offsetGet(mixed $offset): mixed
{
return $this->definitions[$offset] ?? null;
}
/**
* @param mixed $offset
* @param mixed $value
* @throws \BadMethodCallException
*/
public function offsetSet(mixed $offset, mixed $value): void
{
throw new \BadMethodCallException(
'ShapeMap is read-only and cannot be modified.'
);
}
/**
* @param mixed $offset
* @throws \BadMethodCallException
*/
public function offsetUnset(mixed $offset): void
{
throw new \BadMethodCallException(
'ShapeMap is read-only and cannot be modified.'
);
}
}

View file

@ -0,0 +1,105 @@
<?php
namespace Aws\Api;
/**
* Represents a structure shape and resolve member shape references.
*/
class StructureShape extends Shape
{
/**
* @var Shape[]
*/
private $members;
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'structure';
if (!isset($definition['members'])) {
$definition['members'] = [];
}
parent::__construct($definition, $shapeMap);
}
/**
* Gets a list of all members
*
* @return Shape[]
*/
public function getMembers()
{
if (empty($this->members)) {
$this->generateMembersHash();
}
return $this->members;
}
/**
* Check if a specific member exists by name.
*
* @param string $name Name of the member to check
*
* @return bool
*/
public function hasMember($name)
{
return isset($this->definition['members'][$name]);
}
/**
* Retrieve a member by name.
*
* @param string $name Name of the member to retrieve
*
* @return Shape
* @throws \InvalidArgumentException if the member is not found.
*/
public function getMember($name)
{
$members = $this->getMembers();
if (!isset($members[$name])) {
throw new \InvalidArgumentException('Unknown member ' . $name);
}
return $members[$name];
}
/**
* Used to look up the shape's original definition.
* ShapeMap::resolve() merges properties from both
* member and target shape definitions, causing certain
* properties like `locationName` to be overwritten.
*
* @return ShapeMap
* @internal This method is for internal use only and should not be used
* by external code. It may be changed or removed without notice.
*/
public function getShapeMap(): ShapeMap
{
return $this->shapeMap;
}
/**
* Used to look up a shape's original definition.
*
* @param string $name
*
* @return array|null
*/
public function getOriginalDefinition(string $name): ?array
{
return $this->shapeMap[$name] ?? null;
}
private function generateMembersHash()
{
$this->members = [];
foreach ($this->definition['members'] as $name => $definition) {
$this->members[$name] = $this->shapeFor($definition);
}
}
}

View file

@ -0,0 +1,26 @@
<?php
namespace Aws\Api;
/**
* Priority ordered collection of supported AWS protocols.
*/
enum SupportedProtocols: string
{
case JSON = 'json';
case REST_JSON = 'rest-json';
case REST_XML = 'rest-xml';
case QUERY = 'query';
case EC2 = 'ec2';
/**
* Check if a protocol is valid.
*
* @param string $protocol
* @return bool True if the protocol is supported, otherwise false.
*/
public static function isSupported(string $protocol): bool
{
return self::tryFrom($protocol) !== null;
}
}

View file

@ -0,0 +1,48 @@
<?php
namespace Aws\Api;
/**
* Represents a timestamp shape.
*/
class TimestampShape extends Shape
{
public function __construct(array $definition, ShapeMap $shapeMap)
{
$definition['type'] = 'timestamp';
parent::__construct($definition, $shapeMap);
}
/**
* Formats a timestamp value for a service.
*
* @param mixed $value Value to format
* @param string $format Format used to serialize the value
*
* @return int|string
* @throws \UnexpectedValueException if the format is unknown.
* @throws \InvalidArgumentException if the value is an unsupported type.
*/
public static function format($value, $format)
{
if ($value instanceof \DateTimeInterface) {
$value = $value->getTimestamp();
} elseif (is_string($value)) {
$value = strtotime($value);
} elseif (!is_int($value)) {
throw new \InvalidArgumentException('Unable to handle the provided'
. ' timestamp type: ' . gettype($value));
}
switch ($format) {
case 'iso8601':
return gmdate('Y-m-d\TH:i:s\Z', $value);
case 'rfc822':
return gmdate('D, d M Y H:i:s \G\M\T', $value);
case 'unixTimestamp':
return $value;
default:
throw new \UnexpectedValueException('Unknown timestamp format: '
. $format);
}
}
}

View file

@ -0,0 +1,336 @@
<?php
namespace Aws\Api;
use Aws;
/**
* Validates a schema against a hash of input.
*/
class Validator
{
private $path = [];
private $errors = [];
private $constraints = [];
private static $defaultConstraints = [
'required' => true,
'min' => true,
'max' => false,
'pattern' => false
];
/**
* @param array $constraints Associative array of constraints to enforce.
* Accepts the following keys: "required", "min",
* "max", and "pattern". If a key is not
* provided, the constraint will assume false.
*/
public function __construct(?array $constraints = null)
{
static $assumedFalseValues = [
'required' => false,
'min' => false,
'max' => false,
'pattern' => false
];
$this->constraints = empty($constraints)
? self::$defaultConstraints
: $constraints + $assumedFalseValues;
}
/**
* Validates the given input against the schema.
*
* @param string $name Operation name
* @param Shape $shape Shape to validate
* @param array $input Input to validate
*
* @throws \InvalidArgumentException if the input is invalid.
*/
public function validate($name, Shape $shape, array $input)
{
$this->dispatch($shape, $input);
if ($this->errors) {
$message = sprintf(
"Found %d error%s while validating the input provided for the "
. "%s operation:\n%s",
count($this->errors),
count($this->errors) > 1 ? 's' : '',
$name,
implode("\n", $this->errors)
);
$this->errors = [];
throw new \InvalidArgumentException($message);
}
}
private function dispatch(Shape $shape, $value)
{
static $methods = [
'structure' => 'check_structure',
'list' => 'check_list',
'map' => 'check_map',
'blob' => 'check_blob',
'boolean' => 'check_boolean',
'integer' => 'check_numeric',
'float' => 'check_numeric',
'long' => 'check_numeric',
'string' => 'check_string',
'byte' => 'check_string',
'char' => 'check_string'
];
$type = $shape->getType();
if (isset($methods[$type])) {
$this->{$methods[$type]}($shape, $value);
}
}
private function check_structure(StructureShape $shape, $value)
{
$isDocument = (isset($shape['document']) && $shape['document']);
$isUnion = (isset($shape['union']) && $shape['union']);
if ($isDocument) {
if (!$this->checkDocumentType($value)) {
$this->addError("is not a valid document type");
return;
}
} elseif ($isUnion) {
if (!$this->checkUnion($value)) {
$this->addError("is a union type and must have exactly one non null value");
return;
}
} elseif (!$this->checkAssociativeArray($value)) {
return;
}
if ($this->constraints['required'] && $shape['required']) {
foreach ($shape['required'] as $req) {
if (!isset($value[$req])) {
$this->path[] = $req;
$this->addError('is missing and is a required parameter');
array_pop($this->path);
}
}
}
if (!$isDocument) {
foreach ($value as $name => $v) {
if ($shape->hasMember($name)) {
$this->path[] = $name;
$this->dispatch(
$shape->getMember($name),
isset($value[$name]) ? $value[$name] : null
);
array_pop($this->path);
}
}
}
}
private function check_list(ListShape $shape, $value)
{
if (!is_array($value)) {
$this->addError('must be an array. Found '
. Aws\describe_type($value));
return;
}
$this->validateRange($shape, count($value), "list element count");
$items = $shape->getMember();
foreach ($value as $index => $v) {
$this->path[] = $index;
$this->dispatch($items, $v);
array_pop($this->path);
}
}
private function check_map(MapShape $shape, $value)
{
if (!$this->checkAssociativeArray($value)) {
return;
}
$values = $shape->getValue();
foreach ($value as $key => $v) {
$this->path[] = $key;
$this->dispatch($values, $v);
array_pop($this->path);
}
}
private function check_blob(Shape $shape, $value)
{
static $valid = [
'string' => true,
'integer' => true,
'double' => true,
'resource' => true
];
$type = gettype($value);
if (!isset($valid[$type])) {
if ($type != 'object' || !method_exists($value, '__toString')) {
$this->addError('must be an fopen resource, a '
. 'GuzzleHttp\Stream\StreamInterface object, or something '
. 'that can be cast to a string. Found '
. Aws\describe_type($value));
}
}
}
private function check_numeric(Shape $shape, $value)
{
if (!is_numeric($value)) {
$this->addError('must be numeric. Found '
. Aws\describe_type($value));
return;
}
$this->validateRange($shape, $value, "numeric value");
}
private function check_boolean(Shape $shape, $value)
{
if (!is_bool($value)) {
$this->addError('must be a boolean. Found '
. Aws\describe_type($value));
}
}
private function check_string(Shape $shape, $value)
{
if ($shape['jsonvalue']) {
if (!self::canJsonEncode($value)) {
$this->addError('must be a value encodable with \'json_encode\'.'
. ' Found ' . Aws\describe_type($value));
}
return;
}
if (!$this->checkCanString($value)) {
$this->addError('must be a string or an object that implements '
. '__toString(). Found ' . Aws\describe_type($value));
return;
}
$value = isset($value) ? $value : '';
$this->validateRange($shape, strlen($value), "string length");
if ($this->constraints['pattern']) {
$pattern = $shape['pattern'];
if ($pattern && !preg_match("/$pattern/", $value)) {
$this->addError("Pattern /$pattern/ failed to match '$value'");
}
}
}
private function validateRange(Shape $shape, $length, $descriptor)
{
if ($this->constraints['min']) {
$min = $shape['min'];
if ($min && $length < $min) {
$this->addError("expected $descriptor to be >= $min, but "
. "found $descriptor of $length");
}
}
if ($this->constraints['max']) {
$max = $shape['max'];
if ($max && $length > $max) {
$this->addError("expected $descriptor to be <= $max, but "
. "found $descriptor of $length");
}
}
}
private function checkArray($arr)
{
return array_is_list($arr) || Aws\is_associative($arr);
}
private function checkCanString($value)
{
static $valid = [
'string' => true,
'integer' => true,
'double' => true,
'NULL' => true,
];
$type = gettype($value);
return isset($valid[$type]) ||
($type == 'object' && method_exists($value, '__toString'));
}
private function checkAssociativeArray($value)
{
$isAssociative = false;
if (is_array($value)) {
$expectedIndex = 0;
$key = key($value);
do {
$isAssociative = $key !== $expectedIndex++;
next($value);
$key = key($value);
} while (!$isAssociative && null !== $key);
}
if (!$isAssociative) {
$this->addError('must be an associative array. Found '
. Aws\describe_type($value));
return false;
}
return true;
}
private function checkDocumentType($value)
{
if (is_array($value)) {
$typeOfFirstKey = gettype(key($value));
foreach ($value as $key => $val) {
if (!$this->checkDocumentType($val) || gettype($key) != $typeOfFirstKey) {
return false;
}
}
return $this->checkArray($value);
}
return is_null($value)
|| is_numeric($value)
|| is_string($value)
|| is_bool($value);
}
private function checkUnion($value)
{
if (is_array($value)) {
$nonNullCount = 0;
foreach ($value as $key => $val) {
if (!is_null($val) && !(strpos($key, "@") === 0)) {
$nonNullCount++;
}
}
return $nonNullCount == 1;
}
return !is_null($value);
}
private function addError($message)
{
$this->errors[] =
implode('', array_map(function ($s) { return "[{$s}]"; }, $this->path))
. ' '
. $message;
}
private function canJsonEncode($data)
{
return !is_resource($data);
}
}

View file

@ -0,0 +1,280 @@
<?php
namespace Aws\ApiGateway;
use Aws\AwsClient;
use Aws\CommandInterface;
use Psr\Http\Message\RequestInterface;
/**
* This client is used to interact with the **AWS API Gateway** service.
*
* @method \Aws\Result createApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiKeyAsync(array $args = [])
* @method \Aws\Result createAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAuthorizerAsync(array $args = [])
* @method \Aws\Result createBasePathMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBasePathMappingAsync(array $args = [])
* @method \Aws\Result createDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDeploymentAsync(array $args = [])
* @method \Aws\Result createDocumentationPart(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDocumentationPartAsync(array $args = [])
* @method \Aws\Result createDocumentationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDocumentationVersionAsync(array $args = [])
* @method \Aws\Result createDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDomainNameAsync(array $args = [])
* @method \Aws\Result createDomainNameAccessAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDomainNameAccessAssociationAsync(array $args = [])
* @method \Aws\Result createModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise createModelAsync(array $args = [])
* @method \Aws\Result createRequestValidator(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRequestValidatorAsync(array $args = [])
* @method \Aws\Result createResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise createResourceAsync(array $args = [])
* @method \Aws\Result createRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRestApiAsync(array $args = [])
* @method \Aws\Result createStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise createStageAsync(array $args = [])
* @method \Aws\Result createUsagePlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise createUsagePlanAsync(array $args = [])
* @method \Aws\Result createUsagePlanKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise createUsagePlanKeyAsync(array $args = [])
* @method \Aws\Result createVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVpcLinkAsync(array $args = [])
* @method \Aws\Result deleteApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApiKeyAsync(array $args = [])
* @method \Aws\Result deleteAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAuthorizerAsync(array $args = [])
* @method \Aws\Result deleteBasePathMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBasePathMappingAsync(array $args = [])
* @method \Aws\Result deleteClientCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteClientCertificateAsync(array $args = [])
* @method \Aws\Result deleteDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDeploymentAsync(array $args = [])
* @method \Aws\Result deleteDocumentationPart(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDocumentationPartAsync(array $args = [])
* @method \Aws\Result deleteDocumentationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDocumentationVersionAsync(array $args = [])
* @method \Aws\Result deleteDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDomainNameAsync(array $args = [])
* @method \Aws\Result deleteDomainNameAccessAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDomainNameAccessAssociationAsync(array $args = [])
* @method \Aws\Result deleteGatewayResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteGatewayResponseAsync(array $args = [])
* @method \Aws\Result deleteIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIntegrationAsync(array $args = [])
* @method \Aws\Result deleteIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIntegrationResponseAsync(array $args = [])
* @method \Aws\Result deleteMethod(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteMethodAsync(array $args = [])
* @method \Aws\Result deleteMethodResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteMethodResponseAsync(array $args = [])
* @method \Aws\Result deleteModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteModelAsync(array $args = [])
* @method \Aws\Result deleteRequestValidator(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRequestValidatorAsync(array $args = [])
* @method \Aws\Result deleteResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteResourceAsync(array $args = [])
* @method \Aws\Result deleteRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRestApiAsync(array $args = [])
* @method \Aws\Result deleteStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteStageAsync(array $args = [])
* @method \Aws\Result deleteUsagePlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteUsagePlanAsync(array $args = [])
* @method \Aws\Result deleteUsagePlanKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteUsagePlanKeyAsync(array $args = [])
* @method \Aws\Result deleteVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVpcLinkAsync(array $args = [])
* @method \Aws\Result flushStageAuthorizersCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise flushStageAuthorizersCacheAsync(array $args = [])
* @method \Aws\Result flushStageCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise flushStageCacheAsync(array $args = [])
* @method \Aws\Result generateClientCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise generateClientCertificateAsync(array $args = [])
* @method \Aws\Result getAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountAsync(array $args = [])
* @method \Aws\Result getApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiKeyAsync(array $args = [])
* @method \Aws\Result getApiKeys(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiKeysAsync(array $args = [])
* @method \Aws\Result getAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAuthorizerAsync(array $args = [])
* @method \Aws\Result getAuthorizers(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAuthorizersAsync(array $args = [])
* @method \Aws\Result getBasePathMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBasePathMappingAsync(array $args = [])
* @method \Aws\Result getBasePathMappings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBasePathMappingsAsync(array $args = [])
* @method \Aws\Result getClientCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getClientCertificateAsync(array $args = [])
* @method \Aws\Result getClientCertificates(array $args = [])
* @method \GuzzleHttp\Promise\Promise getClientCertificatesAsync(array $args = [])
* @method \Aws\Result getDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeploymentAsync(array $args = [])
* @method \Aws\Result getDeployments(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeploymentsAsync(array $args = [])
* @method \Aws\Result getDocumentationPart(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDocumentationPartAsync(array $args = [])
* @method \Aws\Result getDocumentationParts(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDocumentationPartsAsync(array $args = [])
* @method \Aws\Result getDocumentationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDocumentationVersionAsync(array $args = [])
* @method \Aws\Result getDocumentationVersions(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDocumentationVersionsAsync(array $args = [])
* @method \Aws\Result getDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNameAsync(array $args = [])
* @method \Aws\Result getDomainNameAccessAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNameAccessAssociationsAsync(array $args = [])
* @method \Aws\Result getDomainNames(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNamesAsync(array $args = [])
* @method \Aws\Result getExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise getExportAsync(array $args = [])
* @method \Aws\Result getGatewayResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGatewayResponseAsync(array $args = [])
* @method \Aws\Result getGatewayResponses(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGatewayResponsesAsync(array $args = [])
* @method \Aws\Result getIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntegrationAsync(array $args = [])
* @method \Aws\Result getIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntegrationResponseAsync(array $args = [])
* @method \Aws\Result getMethod(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMethodAsync(array $args = [])
* @method \Aws\Result getMethodResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMethodResponseAsync(array $args = [])
* @method \Aws\Result getModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelAsync(array $args = [])
* @method \Aws\Result getModelTemplate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelTemplateAsync(array $args = [])
* @method \Aws\Result getModels(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelsAsync(array $args = [])
* @method \Aws\Result getRequestValidator(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRequestValidatorAsync(array $args = [])
* @method \Aws\Result getRequestValidators(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRequestValidatorsAsync(array $args = [])
* @method \Aws\Result getResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourceAsync(array $args = [])
* @method \Aws\Result getResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResourcesAsync(array $args = [])
* @method \Aws\Result getRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRestApiAsync(array $args = [])
* @method \Aws\Result getRestApis(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRestApisAsync(array $args = [])
* @method \Aws\Result getSdk(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSdkAsync(array $args = [])
* @method \Aws\Result getSdkType(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSdkTypeAsync(array $args = [])
* @method \Aws\Result getSdkTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSdkTypesAsync(array $args = [])
* @method \Aws\Result getStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise getStageAsync(array $args = [])
* @method \Aws\Result getStages(array $args = [])
* @method \GuzzleHttp\Promise\Promise getStagesAsync(array $args = [])
* @method \Aws\Result getTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTagsAsync(array $args = [])
* @method \Aws\Result getUsage(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUsageAsync(array $args = [])
* @method \Aws\Result getUsagePlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUsagePlanAsync(array $args = [])
* @method \Aws\Result getUsagePlanKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUsagePlanKeyAsync(array $args = [])
* @method \Aws\Result getUsagePlanKeys(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUsagePlanKeysAsync(array $args = [])
* @method \Aws\Result getUsagePlans(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUsagePlansAsync(array $args = [])
* @method \Aws\Result getVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVpcLinkAsync(array $args = [])
* @method \Aws\Result getVpcLinks(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVpcLinksAsync(array $args = [])
* @method \Aws\Result importApiKeys(array $args = [])
* @method \GuzzleHttp\Promise\Promise importApiKeysAsync(array $args = [])
* @method \Aws\Result importDocumentationParts(array $args = [])
* @method \GuzzleHttp\Promise\Promise importDocumentationPartsAsync(array $args = [])
* @method \Aws\Result importRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise importRestApiAsync(array $args = [])
* @method \Aws\Result putGatewayResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise putGatewayResponseAsync(array $args = [])
* @method \Aws\Result putIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putIntegrationAsync(array $args = [])
* @method \Aws\Result putIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise putIntegrationResponseAsync(array $args = [])
* @method \Aws\Result putMethod(array $args = [])
* @method \GuzzleHttp\Promise\Promise putMethodAsync(array $args = [])
* @method \Aws\Result putMethodResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise putMethodResponseAsync(array $args = [])
* @method \Aws\Result putRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRestApiAsync(array $args = [])
* @method \Aws\Result rejectDomainNameAccessAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise rejectDomainNameAccessAssociationAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result testInvokeAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise testInvokeAuthorizerAsync(array $args = [])
* @method \Aws\Result testInvokeMethod(array $args = [])
* @method \GuzzleHttp\Promise\Promise testInvokeMethodAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAccountAsync(array $args = [])
* @method \Aws\Result updateApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApiKeyAsync(array $args = [])
* @method \Aws\Result updateAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAuthorizerAsync(array $args = [])
* @method \Aws\Result updateBasePathMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBasePathMappingAsync(array $args = [])
* @method \Aws\Result updateClientCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateClientCertificateAsync(array $args = [])
* @method \Aws\Result updateDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDeploymentAsync(array $args = [])
* @method \Aws\Result updateDocumentationPart(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDocumentationPartAsync(array $args = [])
* @method \Aws\Result updateDocumentationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDocumentationVersionAsync(array $args = [])
* @method \Aws\Result updateDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDomainNameAsync(array $args = [])
* @method \Aws\Result updateGatewayResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateGatewayResponseAsync(array $args = [])
* @method \Aws\Result updateIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateIntegrationAsync(array $args = [])
* @method \Aws\Result updateIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateIntegrationResponseAsync(array $args = [])
* @method \Aws\Result updateMethod(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateMethodAsync(array $args = [])
* @method \Aws\Result updateMethodResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateMethodResponseAsync(array $args = [])
* @method \Aws\Result updateModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateModelAsync(array $args = [])
* @method \Aws\Result updateRequestValidator(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRequestValidatorAsync(array $args = [])
* @method \Aws\Result updateResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateResourceAsync(array $args = [])
* @method \Aws\Result updateRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRestApiAsync(array $args = [])
* @method \Aws\Result updateStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateStageAsync(array $args = [])
* @method \Aws\Result updateUsage(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateUsageAsync(array $args = [])
* @method \Aws\Result updateUsagePlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateUsagePlanAsync(array $args = [])
* @method \Aws\Result updateVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVpcLinkAsync(array $args = [])
*/
class ApiGatewayClient extends AwsClient
{
public function __construct(array $args)
{
parent::__construct($args);
$stack = $this->getHandlerList();
$stack->appendBuild([__CLASS__, '_add_accept_header']);
}
public static function _add_accept_header(callable $handler)
{
return function (
CommandInterface $command,
RequestInterface $request
) use ($handler) {
$request = $request->withHeader('Accept', 'application/json');
return $handler($command, $request);
};
}
}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ApiGateway\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS API Gateway** service.
*/
class ApiGatewayException extends AwsException {}

View file

@ -0,0 +1,15 @@
<?php
namespace Aws\ApiGatewayManagementApi;
use Aws\AwsClient;
/**
* This client is used to interact with the **AmazonApiGatewayManagementApi** service.
* @method \Aws\Result deleteConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteConnectionAsync(array $args = [])
* @method \Aws\Result getConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConnectionAsync(array $args = [])
* @method \Aws\Result postToConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise postToConnectionAsync(array $args = [])
*/
class ApiGatewayManagementApiClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ApiGatewayManagementApi\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AmazonApiGatewayManagementApi** service.
*/
class ApiGatewayManagementApiException extends AwsException {}

View file

@ -0,0 +1,163 @@
<?php
namespace Aws\ApiGatewayV2;
use Aws\AwsClient;
/**
* This client is used to interact with the **AmazonApiGatewayV2** service.
* @method \Aws\Result createApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiAsync(array $args = [])
* @method \Aws\Result createApiMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiMappingAsync(array $args = [])
* @method \Aws\Result createAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAuthorizerAsync(array $args = [])
* @method \Aws\Result createDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDeploymentAsync(array $args = [])
* @method \Aws\Result createDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDomainNameAsync(array $args = [])
* @method \Aws\Result createIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createIntegrationAsync(array $args = [])
* @method \Aws\Result createIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise createIntegrationResponseAsync(array $args = [])
* @method \Aws\Result createModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise createModelAsync(array $args = [])
* @method \Aws\Result createRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRouteAsync(array $args = [])
* @method \Aws\Result createRouteResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRouteResponseAsync(array $args = [])
* @method \Aws\Result createRoutingRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRoutingRuleAsync(array $args = [])
* @method \Aws\Result createStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise createStageAsync(array $args = [])
* @method \Aws\Result createVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVpcLinkAsync(array $args = [])
* @method \Aws\Result deleteAccessLogSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAccessLogSettingsAsync(array $args = [])
* @method \Aws\Result deleteApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApiAsync(array $args = [])
* @method \Aws\Result deleteApiMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApiMappingAsync(array $args = [])
* @method \Aws\Result deleteAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAuthorizerAsync(array $args = [])
* @method \Aws\Result deleteCorsConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteCorsConfigurationAsync(array $args = [])
* @method \Aws\Result deleteDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDeploymentAsync(array $args = [])
* @method \Aws\Result deleteDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDomainNameAsync(array $args = [])
* @method \Aws\Result deleteIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIntegrationAsync(array $args = [])
* @method \Aws\Result deleteIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIntegrationResponseAsync(array $args = [])
* @method \Aws\Result deleteModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteModelAsync(array $args = [])
* @method \Aws\Result deleteRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRouteAsync(array $args = [])
* @method \Aws\Result deleteRouteRequestParameter(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRouteRequestParameterAsync(array $args = [])
* @method \Aws\Result deleteRouteResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRouteResponseAsync(array $args = [])
* @method \Aws\Result deleteRouteSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRouteSettingsAsync(array $args = [])
* @method \Aws\Result deleteRoutingRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRoutingRuleAsync(array $args = [])
* @method \Aws\Result deleteStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteStageAsync(array $args = [])
* @method \Aws\Result deleteVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVpcLinkAsync(array $args = [])
* @method \Aws\Result exportApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportApiAsync(array $args = [])
* @method \Aws\Result resetAuthorizersCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise resetAuthorizersCacheAsync(array $args = [])
* @method \Aws\Result getApiResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiResourceAsync(array $args = [])
* @method \Aws\Result getApiMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiMappingAsync(array $args = [])
* @method \Aws\Result getApiMappings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiMappingsAsync(array $args = [])
* @method \Aws\Result getApis(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApisAsync(array $args = [])
* @method \Aws\Result getAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAuthorizerAsync(array $args = [])
* @method \Aws\Result getAuthorizers(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAuthorizersAsync(array $args = [])
* @method \Aws\Result getDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeploymentAsync(array $args = [])
* @method \Aws\Result getDeployments(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeploymentsAsync(array $args = [])
* @method \Aws\Result getDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNameAsync(array $args = [])
* @method \Aws\Result getDomainNames(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNamesAsync(array $args = [])
* @method \Aws\Result getIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntegrationAsync(array $args = [])
* @method \Aws\Result getIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntegrationResponseAsync(array $args = [])
* @method \Aws\Result getIntegrationResponses(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntegrationResponsesAsync(array $args = [])
* @method \Aws\Result getIntegrations(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntegrationsAsync(array $args = [])
* @method \Aws\Result getModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelAsync(array $args = [])
* @method \Aws\Result getModelTemplate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelTemplateAsync(array $args = [])
* @method \Aws\Result getModels(array $args = [])
* @method \GuzzleHttp\Promise\Promise getModelsAsync(array $args = [])
* @method \Aws\Result getRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRouteAsync(array $args = [])
* @method \Aws\Result getRouteResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRouteResponseAsync(array $args = [])
* @method \Aws\Result getRouteResponses(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRouteResponsesAsync(array $args = [])
* @method \Aws\Result getRoutes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRoutesAsync(array $args = [])
* @method \Aws\Result getRoutingRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRoutingRuleAsync(array $args = [])
* @method \Aws\Result listRoutingRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRoutingRulesAsync(array $args = [])
* @method \Aws\Result getStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise getStageAsync(array $args = [])
* @method \Aws\Result getStages(array $args = [])
* @method \GuzzleHttp\Promise\Promise getStagesAsync(array $args = [])
* @method \Aws\Result getTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTagsAsync(array $args = [])
* @method \Aws\Result getVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVpcLinkAsync(array $args = [])
* @method \Aws\Result getVpcLinks(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVpcLinksAsync(array $args = [])
* @method \Aws\Result importApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise importApiAsync(array $args = [])
* @method \Aws\Result putRoutingRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRoutingRuleAsync(array $args = [])
* @method \Aws\Result reimportApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise reimportApiAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApiAsync(array $args = [])
* @method \Aws\Result updateApiMapping(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApiMappingAsync(array $args = [])
* @method \Aws\Result updateAuthorizer(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAuthorizerAsync(array $args = [])
* @method \Aws\Result updateDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDeploymentAsync(array $args = [])
* @method \Aws\Result updateDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDomainNameAsync(array $args = [])
* @method \Aws\Result updateIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateIntegrationAsync(array $args = [])
* @method \Aws\Result updateIntegrationResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateIntegrationResponseAsync(array $args = [])
* @method \Aws\Result updateModel(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateModelAsync(array $args = [])
* @method \Aws\Result updateRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRouteAsync(array $args = [])
* @method \Aws\Result updateRouteResponse(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRouteResponseAsync(array $args = [])
* @method \Aws\Result updateStage(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateStageAsync(array $args = [])
* @method \Aws\Result updateVpcLink(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVpcLinkAsync(array $args = [])
*/
class ApiGatewayV2Client extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ApiGatewayV2\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AmazonApiGatewayV2** service.
*/
class ApiGatewayV2Exception extends AwsException {}

View file

@ -0,0 +1,99 @@
<?php
namespace Aws\AppConfig;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon AppConfig** service.
* @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createConfigurationProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise createConfigurationProfileAsync(array $args = [])
* @method \Aws\Result createDeploymentStrategy(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDeploymentStrategyAsync(array $args = [])
* @method \Aws\Result createEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEnvironmentAsync(array $args = [])
* @method \Aws\Result createExtension(array $args = [])
* @method \GuzzleHttp\Promise\Promise createExtensionAsync(array $args = [])
* @method \Aws\Result createExtensionAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createExtensionAssociationAsync(array $args = [])
* @method \Aws\Result createHostedConfigurationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise createHostedConfigurationVersionAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = [])
* @method \Aws\Result deleteConfigurationProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteConfigurationProfileAsync(array $args = [])
* @method \Aws\Result deleteDeploymentStrategy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDeploymentStrategyAsync(array $args = [])
* @method \Aws\Result deleteEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEnvironmentAsync(array $args = [])
* @method \Aws\Result deleteExtension(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteExtensionAsync(array $args = [])
* @method \Aws\Result deleteExtensionAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteExtensionAssociationAsync(array $args = [])
* @method \Aws\Result deleteHostedConfigurationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteHostedConfigurationVersionAsync(array $args = [])
* @method \Aws\Result getAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountSettingsAsync(array $args = [])
* @method \Aws\Result getApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApplicationAsync(array $args = [])
* @method \Aws\Result getConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConfigurationAsync(array $args = [])
* @method \Aws\Result getConfigurationProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConfigurationProfileAsync(array $args = [])
* @method \Aws\Result getDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeploymentAsync(array $args = [])
* @method \Aws\Result getDeploymentStrategy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeploymentStrategyAsync(array $args = [])
* @method \Aws\Result getEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEnvironmentAsync(array $args = [])
* @method \Aws\Result getExtension(array $args = [])
* @method \GuzzleHttp\Promise\Promise getExtensionAsync(array $args = [])
* @method \Aws\Result getExtensionAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getExtensionAssociationAsync(array $args = [])
* @method \Aws\Result getHostedConfigurationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getHostedConfigurationVersionAsync(array $args = [])
* @method \Aws\Result listApplications(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = [])
* @method \Aws\Result listConfigurationProfiles(array $args = [])
* @method \GuzzleHttp\Promise\Promise listConfigurationProfilesAsync(array $args = [])
* @method \Aws\Result listDeploymentStrategies(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDeploymentStrategiesAsync(array $args = [])
* @method \Aws\Result listDeployments(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDeploymentsAsync(array $args = [])
* @method \Aws\Result listEnvironments(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEnvironmentsAsync(array $args = [])
* @method \Aws\Result listExtensionAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listExtensionAssociationsAsync(array $args = [])
* @method \Aws\Result listExtensions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listExtensionsAsync(array $args = [])
* @method \Aws\Result listHostedConfigurationVersions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listHostedConfigurationVersionsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDeploymentAsync(array $args = [])
* @method \Aws\Result stopDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopDeploymentAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAccountSettingsAsync(array $args = [])
* @method \Aws\Result updateApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
* @method \Aws\Result updateConfigurationProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateConfigurationProfileAsync(array $args = [])
* @method \Aws\Result updateDeploymentStrategy(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDeploymentStrategyAsync(array $args = [])
* @method \Aws\Result updateEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEnvironmentAsync(array $args = [])
* @method \Aws\Result updateExtension(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateExtensionAsync(array $args = [])
* @method \Aws\Result updateExtensionAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateExtensionAssociationAsync(array $args = [])
* @method \Aws\Result validateConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise validateConfigurationAsync(array $args = [])
*/
class AppConfigClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppConfig\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Amazon AppConfig** service.
*/
class AppConfigException extends AwsException {}

View file

@ -0,0 +1,13 @@
<?php
namespace Aws\AppConfigData;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS AppConfig Data** service.
* @method \Aws\Result getLatestConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getLatestConfigurationAsync(array $args = [])
* @method \Aws\Result startConfigurationSession(array $args = [])
* @method \GuzzleHttp\Promise\Promise startConfigurationSessionAsync(array $args = [])
*/
class AppConfigDataClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppConfigData\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS AppConfig Data** service.
*/
class AppConfigDataException extends AwsException {}

View file

@ -0,0 +1,61 @@
<?php
namespace Aws\AppFabric;
use Aws\AwsClient;
/**
* This client is used to interact with the **AppFabric** service.
* @method \Aws\Result batchGetUserAccessTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchGetUserAccessTasksAsync(array $args = [])
* @method \Aws\Result connectAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise connectAppAuthorizationAsync(array $args = [])
* @method \Aws\Result createAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppAuthorizationAsync(array $args = [])
* @method \Aws\Result createAppBundle(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAppBundleAsync(array $args = [])
* @method \Aws\Result createIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise createIngestionAsync(array $args = [])
* @method \Aws\Result createIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise createIngestionDestinationAsync(array $args = [])
* @method \Aws\Result deleteAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppAuthorizationAsync(array $args = [])
* @method \Aws\Result deleteAppBundle(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAppBundleAsync(array $args = [])
* @method \Aws\Result deleteIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIngestionAsync(array $args = [])
* @method \Aws\Result deleteIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteIngestionDestinationAsync(array $args = [])
* @method \Aws\Result getAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAppAuthorizationAsync(array $args = [])
* @method \Aws\Result getAppBundle(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAppBundleAsync(array $args = [])
* @method \Aws\Result getIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIngestionAsync(array $args = [])
* @method \Aws\Result getIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIngestionDestinationAsync(array $args = [])
* @method \Aws\Result listAppAuthorizations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAppAuthorizationsAsync(array $args = [])
* @method \Aws\Result listAppBundles(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAppBundlesAsync(array $args = [])
* @method \Aws\Result listIngestionDestinations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listIngestionDestinationsAsync(array $args = [])
* @method \Aws\Result listIngestions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listIngestionsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise startIngestionAsync(array $args = [])
* @method \Aws\Result startUserAccessTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise startUserAccessTasksAsync(array $args = [])
* @method \Aws\Result stopIngestion(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopIngestionAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateAppAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAppAuthorizationAsync(array $args = [])
* @method \Aws\Result updateIngestionDestination(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateIngestionDestinationAsync(array $args = [])
*/
class AppFabricClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppFabric\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AppFabric** service.
*/
class AppFabricException extends AwsException {}

View file

@ -0,0 +1,55 @@
<?php
namespace Aws\AppIntegrationsService;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon AppIntegrations Service** service.
* @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataIntegrationAsync(array $args = [])
* @method \Aws\Result createDataIntegrationAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataIntegrationAssociationAsync(array $args = [])
* @method \Aws\Result createEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createEventIntegrationAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = [])
* @method \Aws\Result deleteDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataIntegrationAsync(array $args = [])
* @method \Aws\Result deleteEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEventIntegrationAsync(array $args = [])
* @method \Aws\Result getApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApplicationAsync(array $args = [])
* @method \Aws\Result getDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataIntegrationAsync(array $args = [])
* @method \Aws\Result getEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEventIntegrationAsync(array $args = [])
* @method \Aws\Result listApplicationAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationAssociationsAsync(array $args = [])
* @method \Aws\Result listApplications(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = [])
* @method \Aws\Result listDataIntegrationAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataIntegrationAssociationsAsync(array $args = [])
* @method \Aws\Result listDataIntegrations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataIntegrationsAsync(array $args = [])
* @method \Aws\Result listEventIntegrationAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEventIntegrationAssociationsAsync(array $args = [])
* @method \Aws\Result listEventIntegrations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEventIntegrationsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
* @method \Aws\Result updateDataIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataIntegrationAsync(array $args = [])
* @method \Aws\Result updateDataIntegrationAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataIntegrationAssociationAsync(array $args = [])
* @method \Aws\Result updateEventIntegration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEventIntegrationAsync(array $args = [])
*/
class AppIntegrationsServiceClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppIntegrationsService\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Amazon AppIntegrations Service** service.
*/
class AppIntegrationsServiceException extends AwsException {}

View file

@ -0,0 +1,85 @@
<?php
namespace Aws\AppMesh;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS App Mesh** service.
* @method \Aws\Result createMesh(array $args = [])
* @method \GuzzleHttp\Promise\Promise createMeshAsync(array $args = [])
* @method \Aws\Result createRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRouteAsync(array $args = [])
* @method \Aws\Result createVirtualNode(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVirtualNodeAsync(array $args = [])
* @method \Aws\Result createVirtualRouter(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVirtualRouterAsync(array $args = [])
* @method \Aws\Result deleteMesh(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteMeshAsync(array $args = [])
* @method \Aws\Result deleteRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRouteAsync(array $args = [])
* @method \Aws\Result deleteVirtualNode(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVirtualNodeAsync(array $args = [])
* @method \Aws\Result deleteVirtualRouter(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVirtualRouterAsync(array $args = [])
* @method \Aws\Result describeMesh(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeMeshAsync(array $args = [])
* @method \Aws\Result describeRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeRouteAsync(array $args = [])
* @method \Aws\Result describeVirtualNode(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeVirtualNodeAsync(array $args = [])
* @method \Aws\Result describeVirtualRouter(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeVirtualRouterAsync(array $args = [])
* @method \Aws\Result listMeshes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listMeshesAsync(array $args = [])
* @method \Aws\Result listRoutes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRoutesAsync(array $args = [])
* @method \Aws\Result listVirtualNodes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVirtualNodesAsync(array $args = [])
* @method \Aws\Result listVirtualRouters(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVirtualRoutersAsync(array $args = [])
* @method \Aws\Result updateRoute(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRouteAsync(array $args = [])
* @method \Aws\Result updateVirtualNode(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVirtualNodeAsync(array $args = [])
* @method \Aws\Result updateVirtualRouter(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVirtualRouterAsync(array $args = [])
* @method \Aws\Result createGatewayRoute(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise createGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result createVirtualGateway(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise createVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result createVirtualService(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise createVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result deleteGatewayRoute(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise deleteGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result deleteVirtualGateway(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise deleteVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result deleteVirtualService(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise deleteVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result describeGatewayRoute(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise describeGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result describeVirtualGateway(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise describeVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result describeVirtualService(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise describeVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result listGatewayRoutes(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise listGatewayRoutesAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result listTagsForResource(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result listVirtualGateways(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise listVirtualGatewaysAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result listVirtualServices(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise listVirtualServicesAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result tagResource(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result untagResource(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result updateGatewayRoute(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise updateGatewayRouteAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result updateMesh(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise updateMeshAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result updateVirtualGateway(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise updateVirtualGatewayAsync(array $args = []) (supported in versions 2019-01-25)
* @method \Aws\Result updateVirtualService(array $args = []) (supported in versions 2019-01-25)
* @method \GuzzleHttp\Promise\Promise updateVirtualServiceAsync(array $args = []) (supported in versions 2019-01-25)
*/
class AppMeshClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppMesh\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS App Mesh** service.
*/
class AppMeshException extends AwsException {}

View file

@ -0,0 +1,57 @@
<?php
namespace Aws\AppRegistry;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Service Catalog App Registry** service.
* @method \Aws\Result associateAttributeGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateAttributeGroupAsync(array $args = [])
* @method \Aws\Result associateResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateResourceAsync(array $args = [])
* @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createAttributeGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAttributeGroupAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = [])
* @method \Aws\Result deleteAttributeGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAttributeGroupAsync(array $args = [])
* @method \Aws\Result disassociateAttributeGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateAttributeGroupAsync(array $args = [])
* @method \Aws\Result disassociateResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateResourceAsync(array $args = [])
* @method \Aws\Result getApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApplicationAsync(array $args = [])
* @method \Aws\Result getAssociatedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAssociatedResourceAsync(array $args = [])
* @method \Aws\Result getAttributeGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAttributeGroupAsync(array $args = [])
* @method \Aws\Result getConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConfigurationAsync(array $args = [])
* @method \Aws\Result listApplications(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = [])
* @method \Aws\Result listAssociatedAttributeGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAssociatedAttributeGroupsAsync(array $args = [])
* @method \Aws\Result listAssociatedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAssociatedResourcesAsync(array $args = [])
* @method \Aws\Result listAttributeGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAttributeGroupsAsync(array $args = [])
* @method \Aws\Result listAttributeGroupsForApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAttributeGroupsForApplicationAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putConfigurationAsync(array $args = [])
* @method \Aws\Result syncResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise syncResourceAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApplicationAsync(array $args = [])
* @method \Aws\Result updateAttributeGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAttributeGroupAsync(array $args = [])
*/
class AppRegistryClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppRegistry\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Service Catalog App Registry** service.
*/
class AppRegistryException extends AwsException {}

View file

@ -0,0 +1,83 @@
<?php
namespace Aws\AppRunner;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS App Runner** service.
* @method \Aws\Result associateCustomDomain(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateCustomDomainAsync(array $args = [])
* @method \Aws\Result createAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result createConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise createConnectionAsync(array $args = [])
* @method \Aws\Result createObservabilityConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createObservabilityConfigurationAsync(array $args = [])
* @method \Aws\Result createService(array $args = [])
* @method \GuzzleHttp\Promise\Promise createServiceAsync(array $args = [])
* @method \Aws\Result createVpcConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVpcConnectorAsync(array $args = [])
* @method \Aws\Result createVpcIngressConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVpcIngressConnectionAsync(array $args = [])
* @method \Aws\Result deleteAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result deleteConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteConnectionAsync(array $args = [])
* @method \Aws\Result deleteObservabilityConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteObservabilityConfigurationAsync(array $args = [])
* @method \Aws\Result deleteService(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteServiceAsync(array $args = [])
* @method \Aws\Result deleteVpcConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVpcConnectorAsync(array $args = [])
* @method \Aws\Result deleteVpcIngressConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVpcIngressConnectionAsync(array $args = [])
* @method \Aws\Result describeAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result describeCustomDomains(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCustomDomainsAsync(array $args = [])
* @method \Aws\Result describeObservabilityConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeObservabilityConfigurationAsync(array $args = [])
* @method \Aws\Result describeService(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeServiceAsync(array $args = [])
* @method \Aws\Result describeVpcConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeVpcConnectorAsync(array $args = [])
* @method \Aws\Result describeVpcIngressConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeVpcIngressConnectionAsync(array $args = [])
* @method \Aws\Result disassociateCustomDomain(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateCustomDomainAsync(array $args = [])
* @method \Aws\Result listAutoScalingConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAutoScalingConfigurationsAsync(array $args = [])
* @method \Aws\Result listConnections(array $args = [])
* @method \GuzzleHttp\Promise\Promise listConnectionsAsync(array $args = [])
* @method \Aws\Result listObservabilityConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listObservabilityConfigurationsAsync(array $args = [])
* @method \Aws\Result listOperations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listOperationsAsync(array $args = [])
* @method \Aws\Result listServices(array $args = [])
* @method \GuzzleHttp\Promise\Promise listServicesAsync(array $args = [])
* @method \Aws\Result listServicesForAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise listServicesForAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listVpcConnectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVpcConnectorsAsync(array $args = [])
* @method \Aws\Result listVpcIngressConnections(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVpcIngressConnectionsAsync(array $args = [])
* @method \Aws\Result pauseService(array $args = [])
* @method \GuzzleHttp\Promise\Promise pauseServiceAsync(array $args = [])
* @method \Aws\Result resumeService(array $args = [])
* @method \GuzzleHttp\Promise\Promise resumeServiceAsync(array $args = [])
* @method \Aws\Result startDeployment(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDeploymentAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateDefaultAutoScalingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDefaultAutoScalingConfigurationAsync(array $args = [])
* @method \Aws\Result updateService(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateServiceAsync(array $args = [])
* @method \Aws\Result updateVpcIngressConnection(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVpcIngressConnectionAsync(array $args = [])
*/
class AppRunnerClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppRunner\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS App Runner** service.
*/
class AppRunnerException extends AwsException {}

View file

@ -0,0 +1,157 @@
<?php
namespace Aws\AppSync;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS AppSync** service.
* @method \Aws\Result associateApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateApiAsync(array $args = [])
* @method \Aws\Result associateMergedGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateMergedGraphqlApiAsync(array $args = [])
* @method \Aws\Result associateSourceGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateSourceGraphqlApiAsync(array $args = [])
* @method \Aws\Result createApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiAsync(array $args = [])
* @method \Aws\Result createApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiCacheAsync(array $args = [])
* @method \Aws\Result createApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApiKeyAsync(array $args = [])
* @method \Aws\Result createChannelNamespace(array $args = [])
* @method \GuzzleHttp\Promise\Promise createChannelNamespaceAsync(array $args = [])
* @method \Aws\Result createDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataSourceAsync(array $args = [])
* @method \Aws\Result createDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDomainNameAsync(array $args = [])
* @method \Aws\Result createFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise createFunctionAsync(array $args = [])
* @method \Aws\Result createGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise createGraphqlApiAsync(array $args = [])
* @method \Aws\Result createResolver(array $args = [])
* @method \GuzzleHttp\Promise\Promise createResolverAsync(array $args = [])
* @method \Aws\Result createType(array $args = [])
* @method \GuzzleHttp\Promise\Promise createTypeAsync(array $args = [])
* @method \Aws\Result deleteApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApiAsync(array $args = [])
* @method \Aws\Result deleteApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApiCacheAsync(array $args = [])
* @method \Aws\Result deleteApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApiKeyAsync(array $args = [])
* @method \Aws\Result deleteChannelNamespace(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteChannelNamespaceAsync(array $args = [])
* @method \Aws\Result deleteDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataSourceAsync(array $args = [])
* @method \Aws\Result deleteDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDomainNameAsync(array $args = [])
* @method \Aws\Result deleteFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteFunctionAsync(array $args = [])
* @method \Aws\Result deleteGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteGraphqlApiAsync(array $args = [])
* @method \Aws\Result deleteResolver(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteResolverAsync(array $args = [])
* @method \Aws\Result deleteType(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTypeAsync(array $args = [])
* @method \Aws\Result disassociateApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateApiAsync(array $args = [])
* @method \Aws\Result disassociateMergedGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateMergedGraphqlApiAsync(array $args = [])
* @method \Aws\Result disassociateSourceGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateSourceGraphqlApiAsync(array $args = [])
* @method \Aws\Result evaluateCode(array $args = [])
* @method \GuzzleHttp\Promise\Promise evaluateCodeAsync(array $args = [])
* @method \Aws\Result evaluateMappingTemplate(array $args = [])
* @method \GuzzleHttp\Promise\Promise evaluateMappingTemplateAsync(array $args = [])
* @method \Aws\Result flushApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise flushApiCacheAsync(array $args = [])
* @method \Aws\Result getApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiAsync(array $args = [])
* @method \Aws\Result getApiAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiAssociationAsync(array $args = [])
* @method \Aws\Result getApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiCacheAsync(array $args = [])
* @method \Aws\Result getChannelNamespace(array $args = [])
* @method \GuzzleHttp\Promise\Promise getChannelNamespaceAsync(array $args = [])
* @method \Aws\Result getDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataSourceAsync(array $args = [])
* @method \Aws\Result getDataSourceIntrospection(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataSourceIntrospectionAsync(array $args = [])
* @method \Aws\Result getDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDomainNameAsync(array $args = [])
* @method \Aws\Result getFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFunctionAsync(array $args = [])
* @method \Aws\Result getGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGraphqlApiAsync(array $args = [])
* @method \Aws\Result getGraphqlApiEnvironmentVariables(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGraphqlApiEnvironmentVariablesAsync(array $args = [])
* @method \Aws\Result getIntrospectionSchema(array $args = [])
* @method \GuzzleHttp\Promise\Promise getIntrospectionSchemaAsync(array $args = [])
* @method \Aws\Result getResolver(array $args = [])
* @method \GuzzleHttp\Promise\Promise getResolverAsync(array $args = [])
* @method \Aws\Result getSchemaCreationStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSchemaCreationStatusAsync(array $args = [])
* @method \Aws\Result getSourceApiAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSourceApiAssociationAsync(array $args = [])
* @method \Aws\Result getType(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTypeAsync(array $args = [])
* @method \Aws\Result listApiKeys(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApiKeysAsync(array $args = [])
* @method \Aws\Result listApis(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApisAsync(array $args = [])
* @method \Aws\Result listChannelNamespaces(array $args = [])
* @method \GuzzleHttp\Promise\Promise listChannelNamespacesAsync(array $args = [])
* @method \Aws\Result listDataSources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataSourcesAsync(array $args = [])
* @method \Aws\Result listDomainNames(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDomainNamesAsync(array $args = [])
* @method \Aws\Result listFunctions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFunctionsAsync(array $args = [])
* @method \Aws\Result listGraphqlApis(array $args = [])
* @method \GuzzleHttp\Promise\Promise listGraphqlApisAsync(array $args = [])
* @method \Aws\Result listResolvers(array $args = [])
* @method \GuzzleHttp\Promise\Promise listResolversAsync(array $args = [])
* @method \Aws\Result listResolversByFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise listResolversByFunctionAsync(array $args = [])
* @method \Aws\Result listSourceApiAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listSourceApiAssociationsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypesAsync(array $args = [])
* @method \Aws\Result listTypesByAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypesByAssociationAsync(array $args = [])
* @method \Aws\Result putGraphqlApiEnvironmentVariables(array $args = [])
* @method \GuzzleHttp\Promise\Promise putGraphqlApiEnvironmentVariablesAsync(array $args = [])
* @method \Aws\Result startDataSourceIntrospection(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDataSourceIntrospectionAsync(array $args = [])
* @method \Aws\Result startSchemaCreation(array $args = [])
* @method \GuzzleHttp\Promise\Promise startSchemaCreationAsync(array $args = [])
* @method \Aws\Result startSchemaMerge(array $args = [])
* @method \GuzzleHttp\Promise\Promise startSchemaMergeAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApiAsync(array $args = [])
* @method \Aws\Result updateApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApiCacheAsync(array $args = [])
* @method \Aws\Result updateApiKey(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateApiKeyAsync(array $args = [])
* @method \Aws\Result updateChannelNamespace(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateChannelNamespaceAsync(array $args = [])
* @method \Aws\Result updateDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataSourceAsync(array $args = [])
* @method \Aws\Result updateDomainName(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDomainNameAsync(array $args = [])
* @method \Aws\Result updateFunction(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFunctionAsync(array $args = [])
* @method \Aws\Result updateGraphqlApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateGraphqlApiAsync(array $args = [])
* @method \Aws\Result updateResolver(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateResolverAsync(array $args = [])
* @method \Aws\Result updateSourceApiAssociation(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateSourceApiAssociationAsync(array $args = [])
* @method \Aws\Result updateType(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateTypeAsync(array $args = [])
*/
class AppSyncClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppSync\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS AppSync** service.
*/
class AppSyncException extends AwsException {}

View file

@ -0,0 +1,57 @@
<?php
namespace Aws\AppTest;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Mainframe Modernization Application Testing** service.
* @method \Aws\Result createTestCase(array $args = [])
* @method \GuzzleHttp\Promise\Promise createTestCaseAsync(array $args = [])
* @method \Aws\Result createTestConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise createTestConfigurationAsync(array $args = [])
* @method \Aws\Result createTestSuite(array $args = [])
* @method \GuzzleHttp\Promise\Promise createTestSuiteAsync(array $args = [])
* @method \Aws\Result deleteTestCase(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTestCaseAsync(array $args = [])
* @method \Aws\Result deleteTestConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTestConfigurationAsync(array $args = [])
* @method \Aws\Result deleteTestRun(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTestRunAsync(array $args = [])
* @method \Aws\Result deleteTestSuite(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteTestSuiteAsync(array $args = [])
* @method \Aws\Result getTestCase(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTestCaseAsync(array $args = [])
* @method \Aws\Result getTestConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTestConfigurationAsync(array $args = [])
* @method \Aws\Result getTestRunStep(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTestRunStepAsync(array $args = [])
* @method \Aws\Result getTestSuite(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTestSuiteAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listTestCases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTestCasesAsync(array $args = [])
* @method \Aws\Result listTestConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTestConfigurationsAsync(array $args = [])
* @method \Aws\Result listTestRunSteps(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTestRunStepsAsync(array $args = [])
* @method \Aws\Result listTestRunTestCases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTestRunTestCasesAsync(array $args = [])
* @method \Aws\Result listTestRuns(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTestRunsAsync(array $args = [])
* @method \Aws\Result listTestSuites(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTestSuitesAsync(array $args = [])
* @method \Aws\Result startTestRun(array $args = [])
* @method \GuzzleHttp\Promise\Promise startTestRunAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateTestCase(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateTestCaseAsync(array $args = [])
* @method \Aws\Result updateTestConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateTestConfigurationAsync(array $args = [])
* @method \Aws\Result updateTestSuite(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateTestSuiteAsync(array $args = [])
*/
class AppTestClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\AppTest\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Mainframe Modernization Application Testing** service.
*/
class AppTestException extends AwsException {}

View file

@ -0,0 +1,59 @@
<?php
namespace Aws\Appflow;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Appflow** service.
* @method \Aws\Result cancelFlowExecutions(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelFlowExecutionsAsync(array $args = [])
* @method \Aws\Result createConnectorProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise createConnectorProfileAsync(array $args = [])
* @method \Aws\Result createFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise createFlowAsync(array $args = [])
* @method \Aws\Result deleteConnectorProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteConnectorProfileAsync(array $args = [])
* @method \Aws\Result deleteFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteFlowAsync(array $args = [])
* @method \Aws\Result describeConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeConnectorAsync(array $args = [])
* @method \Aws\Result describeConnectorEntity(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeConnectorEntityAsync(array $args = [])
* @method \Aws\Result describeConnectorProfiles(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeConnectorProfilesAsync(array $args = [])
* @method \Aws\Result describeConnectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeConnectorsAsync(array $args = [])
* @method \Aws\Result describeFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeFlowAsync(array $args = [])
* @method \Aws\Result describeFlowExecutionRecords(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeFlowExecutionRecordsAsync(array $args = [])
* @method \Aws\Result listConnectorEntities(array $args = [])
* @method \GuzzleHttp\Promise\Promise listConnectorEntitiesAsync(array $args = [])
* @method \Aws\Result listConnectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise listConnectorsAsync(array $args = [])
* @method \Aws\Result listFlows(array $args = [])
* @method \GuzzleHttp\Promise\Promise listFlowsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result registerConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise registerConnectorAsync(array $args = [])
* @method \Aws\Result resetConnectorMetadataCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise resetConnectorMetadataCacheAsync(array $args = [])
* @method \Aws\Result startFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise startFlowAsync(array $args = [])
* @method \Aws\Result stopFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopFlowAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result unregisterConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise unregisterConnectorAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateConnectorProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateConnectorProfileAsync(array $args = [])
* @method \Aws\Result updateConnectorRegistration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateConnectorRegistrationAsync(array $args = [])
* @method \Aws\Result updateFlow(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFlowAsync(array $args = [])
*/
class AppflowClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\Appflow\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Amazon Appflow** service.
*/
class AppflowException extends AwsException {}

View file

@ -0,0 +1,37 @@
<?php
namespace Aws\ApplicationAutoScaling;
use Aws\AwsClient;
/**
* This client is used to interact with the **Application Auto Scaling** service.
* @method \Aws\Result deleteScalingPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteScalingPolicyAsync(array $args = [])
* @method \Aws\Result deleteScheduledAction(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteScheduledActionAsync(array $args = [])
* @method \Aws\Result deregisterScalableTarget(array $args = [])
* @method \GuzzleHttp\Promise\Promise deregisterScalableTargetAsync(array $args = [])
* @method \Aws\Result describeScalableTargets(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScalableTargetsAsync(array $args = [])
* @method \Aws\Result describeScalingActivities(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScalingActivitiesAsync(array $args = [])
* @method \Aws\Result describeScalingPolicies(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScalingPoliciesAsync(array $args = [])
* @method \Aws\Result describeScheduledActions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScheduledActionsAsync(array $args = [])
* @method \Aws\Result getPredictiveScalingForecast(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPredictiveScalingForecastAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putScalingPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putScalingPolicyAsync(array $args = [])
* @method \Aws\Result putScheduledAction(array $args = [])
* @method \GuzzleHttp\Promise\Promise putScheduledActionAsync(array $args = [])
* @method \Aws\Result registerScalableTarget(array $args = [])
* @method \GuzzleHttp\Promise\Promise registerScalableTargetAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
*/
class ApplicationAutoScalingClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ApplicationAutoScaling\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **Application Auto Scaling** service.
*/
class ApplicationAutoScalingException extends AwsException {}

View file

@ -0,0 +1,21 @@
<?php
namespace Aws\ApplicationCostProfiler;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Application Cost Profiler** service.
* @method \Aws\Result deleteReportDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteReportDefinitionAsync(array $args = [])
* @method \Aws\Result getReportDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise getReportDefinitionAsync(array $args = [])
* @method \Aws\Result importApplicationUsage(array $args = [])
* @method \GuzzleHttp\Promise\Promise importApplicationUsageAsync(array $args = [])
* @method \Aws\Result listReportDefinitions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listReportDefinitionsAsync(array $args = [])
* @method \Aws\Result putReportDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise putReportDefinitionAsync(array $args = [])
* @method \Aws\Result updateReportDefinition(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateReportDefinitionAsync(array $args = [])
*/
class ApplicationCostProfilerClient extends AwsClient {}

View file

@ -0,0 +1,9 @@
<?php
namespace Aws\ApplicationCostProfiler\Exception;
use Aws\Exception\AwsException;
/**
* Represents an error interacting with the **AWS Application Cost Profiler** service.
*/
class ApplicationCostProfilerException extends AwsException {}

Some files were not shown because too many files have changed in this diff Show more