v2: Updates

* Simplifies & beautifies everything
* Introduces a new Class system.
* Errors are defaulted to AWS's handler.
* New function names & more efficient handling.
* Should fix a majority of the errors.

Please read the README for more!
This commit is contained in:
Devang Srivastava 2020-09-28 15:32:51 +05:30
parent ad0726e41e
commit e6d7753dc8
1095 changed files with 45088 additions and 2911 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.DS_Store

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 Devang Srivastava
Copyright (c) 2020 Devang Srivastava
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

547
README.md
View file

@ -1,231 +1,348 @@
# Spaces-API
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSociallyDev%2FSpaces-API.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FSociallyDev%2FSpaces-API?ref=badge_shield)
![Spaces-API](https://i.imgur.com/j70JvUc.png "Devang Srivastava's Spaces-API")
An API wrapper for DigitalOcean's Spaces object storage designed for easy use.
Makes using DigitalOcean's Spaces object storage super easy.
 
* Makes everything super simple.
* Automatically handles multipart & stream uploads for large files.
* Uses Spaces terminology for objects instead of S3.
 
# Example
Create a Space & upload, it's as easy as that.
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Upload some text.
$my_space->upload("Super cool content", "example.txt");
//Uploaded!
```
### tl;dr
- Files
- [Uploading a file](#upload-a-stored-file)
- [Uploading text](#upload-text-directly)
- [Uploading an entire folder](#upload-a-local-folder)
- [Downloading a file](#download-a-file)
- [Downloading your entire Space](#download-your-space-to-a-local-folder)
- [Copy a Space file](#copy-a-file-inside-your-space)
- [List all files](#list-all-files-inside-your-space)
- [Check if file exists](#check-whether-a-file-exists)
- [Retrieve file info](#get-info-on-a-file)
- [Create signed temporary sharing URL](#create-a-signed-url-used-for-sharing-private-files)
- [Retrieve public file URL](#create-an-unsigned-url-used-for-sharing-public-files)
- [Change a file's privacy](#change-a-files-privacy-public--private-acl)
- [Delete a file](#delete-a-file)
- [Delete an entire folder](#delete-an-entire-folder)
### Installation
* **Using Composer**:
```sh
- Spaces
- [Create a new Space](#create-a-new-space)
- [Use an existing Space](#use-an-existing-space)
- [List all Spaces](#list-all-spaces)
- [Change your Space's privacy](#change-your-spaces-privacy-acl)
- [List your Space's CORS rules](#list-your-spaces-cors-rules)
- [Change your Space's CORS rules](#set-your-spaces-cors-rules)
- [Destroy your Space](#destroy-your-space)
 
# Installing Spaces-API
There are two ways to install Spaces-API. You can either download the project & put it directly in your code's folder, or you can use [Composer](https://getcomposer.org).
 
### a) The Manual Way
1) [Download Spaces-API](https://github.com/SociallyDev/Spaces-API/archive/master.zip) & place it in your project.
2) Load it from your code:
```php
require_once("spaces.php");
```
 
### b) The Composer Method
1) Make sure you have [Composer](https://getcomposer.org).
2) Install Spaces-API:
```
composer require sociallydev/spaces-api:dev-master
```
### Connecting
3) Make sure your code has the Composer autoloader:
```php
//Either:
require_once("spaces.php");
//OR COMPOSER:
require_once("vendor/autoload.php"); //Install first by executing: composer require SociallyDev/Spaces-API in your project's directory.
$key = "EXAMPLE_KEY";
$secret = "EXAMPLE_SECRET";
$space_name = "my-space";
$region = "nyc3";
$space = new SpacesConnect($key, $secret, $space_name, $region);
require_once("vendor/autoload.php");
```
All available options:
###### SpacesConnect(REQUIRED KEY, REQUIRED SECRET, OPTIONAL SPACE's NAME, OPTIONAL REGION, OPTIONAL HOST);
 
## Setup
You'll need a DigitalOcean account & API keys to use Spaces-API. You should be able to generate a pair of keys from the [DigitalOcean Dashboard](https://cloud.digitalocean.com/account/api/tokens). In the API page, there should be a section with the title "Spaces access keys". Click "Generate New Key" & follow the steps. That'll give you an access key & a secret key.
### Uploading/Downloading Files
```php
// Don't start any path with a forward slash, or it will give "SignatureDoesNotMatch" exception
$path_to_file = "image.png";
$space->UploadFile($path_to_file, "public");
$download_file = "image.png";
$save_as = "folder/downloaded-image.png";
$space->DownloadFile($download_file, $save_as);
```
All available options:
###### UploadFile(REQUIRED PATH TO FILE, OPTIONAL PRIVACY (public|private) OPTIONAL NAME TO SAVE FILE AS);
###### DownloadFile(REQUIRED FILE TO DOWNLOAD, REQUIRED LOCATION TO SAVE IN);
 
### Deleting Files/Folders
```php
$file_name = "image.png";
$space->DeleteObject($file_name);
```
All available options:
###### DeleteObject(REQUIRED FILE OR FOLDER TO DELETE, OPTIONAL RECURSIVE (false|true));
 
### Changing Privacy Settings
```php
$file = "image.png";
$space->MakePublic($file);
$space->MakePrivate($file);
```
All available options:
###### MakePublic(REQUIRED PATH TO FILE);
###### MakePrivate(REQUIRED PATH TO FILE);
 
### Creating Temporary Links
```php
$file = "image.png";
$valid_for = "1 day";
$link = $space->CreateTemporaryURL($file, $valid_for);
```
All available options:
###### CreateTemporaryURL(REQUIRED FILE NAME, OPTIONAL TIME LINK IS VALID FOR);
 
 
### Other File APIs
```php
//List all files and folders
$files = $space->ListObjects();
//Check if a file/folder by that name already exists. True/False.
$space->DoesObjectExist($file_name);
//Pull information about a single object.
$file_info = $space->GetObject($file_name);
//Upload a complete directory instead of a single file.
$space->UploadDirectory($path_to_directory, $key_prefix);
//Pull Access Control List information.
$acl = $space-ListObjectACL($file_name);
//Update Access Control List information.
$space->PutObjectACL($file_name, $acl_info_array);
```
 
 
 
 
 
### Creating Spaces
```php
$new_space = "my-new-space";
$space->CreateSpace($new_space);
```
All available options:
###### CreateSpace(REQUIRED SPACE NAME, OPTIONAL REGION FOR SPACE);
 
### Switching Spaces
```php
$new_space = "my-new-space";
$space->SetSpace($new_space);
```
All available options:
###### SetSpace(REQUIRED SPACE NAME, OPTIONAL REGION FOR SPACE, OPTIONAL HOST);
 
 
### Other Spaces APIs
```php
//List all Spaces available in account.
$spaces = $space->ListSpaces();
//Delete a Space.
$space->DestroyThisSpace();
//Download whole Space to a folder.
$space->DownloadSpaceToDirectory($directory_to_download_to);
//Get the name of the current Space.
$space_name = $space->GetSpaceName();
//Pull the CORS policy of the Space.
$cors = $space->ListCORS();
//Update the CORS policy of the Space.
$space->PutCORS($new_policy);
//Pull the Access Control List information of the Space.
$acl = $space->ListSpaceACL();
//Update the Access Control List information of the Space.
$space->PutSpaceACL($new_acl);
```
### Handling Errors
We'll be using these keys to initiate a Spaces instance:
```php
try {
$space->CreateSpace("dev");
} catch (\SpacesAPIException $e) {
$error = $e->GetError();
$spaces = Spaces("ACCESS KEY", "SECRET KEY");
```
 
//Error management code.
echo "<pre>";
print_r($error);
/*
EG:
Array (
[message] => Bucket already exists
[code] => BucketAlreadyExists
[type] => client
[http_code] => 409
)
*/
}
## Usage
Once you have a Spaces instance, you can do pretty much anything the Spaces API allows.
Here is an example of downloading all your files to a local directory:
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Download entire Space to a directory.
$my_space->downloadToDirectory("local_backup");
```
&nbsp;
&nbsp;
&nbsp;
&nbsp;
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSociallyDev%2FSpaces-API.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FSociallyDev%2FSpaces-API?ref=badge_large)
![Spaces-API](https://i.imgur.com/pH7QqtP.png "Spaces-API API Reference")
&nbsp;
# Top-Level Spaces Functions
These are all the functions a Spaces instance can perform.
&nbsp;
## Create a new Space
```php
$spaces = Spaces("ACCESS KEY", "SECRET KEY");
//Creates a new Space.
$spaces->create("my-new-space", "nyc3", "private");
```
* The third (Space privacy) argument is optional. Defaults to private.
* Returns a new single Space instance. Same as `$spaces->space("my-new-space")`.
&nbsp;
## Use an existing Space
```php
$spaces = Spaces("ACCESS KEY", "SECRET KEY");
//Get an existing Space.
$my_space = $spaces->space("my-space", "nyc3");
```
&nbsp;
## List all Spaces
```php
$spaces = Spaces("ACCESS KEY", "SECRET KEY");
//Returns an array of all available Spaces.
$spaces->list();
```
&nbsp;
***
&nbsp;
# Single Space Functions
These are all the functions a Space instance (From `$spaces->space("my-new-space")`) can perform!
&nbsp;
## Upload a stored file
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Upload a local stored file.
$my_space->uploadFile("path/to/my/file.txt", "path/on/space.txt", "private");
```
* The second (Save as) argument is optional. Spaces-API attempts to use the original file path as the path on your Space if no save as path is provided.
* The third argument (File privacy) is optional. It defaults to private.
* Returns available info on the file.
&nbsp;
## Upload text directly
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Upload a local stored file.
$my_space->upload("my content", "path/on/space.txt", "private");
```
* The first argument (Content) can be a string, but it can also be a StreamInterface or PHP stream resource.
* The third argument (File privacy) is optional. It defaults to private.
* Returns available info on the file.
&nbsp;
## Upload a local folder
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Uploads an entire local directory.
$my_space->uploadDirectory("my-local-folder");
```
* You can provide a second argument which can be a folder inside your Space where to upload all the files inside the local folder.
&nbsp;
## Download a file
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Returns the file content as result.
$content = $my_space->downloadFile("my-file.txt");
//Saves the file content to the local path, and returns file info.
$info = $my_space->downloadFile("my-file.txt", "save-path/file.txt");
```
&nbsp;
## Download your Space to a local folder
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Uploads an entire local directory.
$my_space->downloadToDirectory("my-local-folder");
```
* You can provide a second argument which can be a folder on your Space. Spaces-API will only download the files inside this folder.
&nbsp;
## Copy a file inside your Space
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Copies the file to the same Space.
$my_space->copyFile("my-file.txt", "my-new-file.txt");
//Copies the file to another Space.
$my_space->copyFile("my-file.txt", "my-new-file.txt", "my-other-space");
```
* DigitalOcean only allows copying across Spaces in the same region.
* You can supply a fourth argument to set the new file's privacy (public/private).
* Returns info on the new file.
&nbsp;
## List all files inside your Space
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Lists all files inside your Space.
$my_space->listFiles();
//Lists all files in a folder inside your Space.
$my_space->listFiles("my-folder");
```
* This function automatically iterates till it gets all files but you can set the second argument to false if you want to handle pagination yourself.
* If you set the second argument to false, you can set the third argument to a ContinuationToken.
* Returns an array of files but if the second argument is set to false, the original object is returned.
&nbsp;
## Check whether a file exists
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Returns true if this file exists, otherwise false.
$my_space->fileExists("my-file.txt");
```
* Because of how Spaces/S3 handles objects, this'll return true for folders that exist.
&nbsp;
## Get info on a file
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Returns all available data on a file.
$my_space->fileInfo("my-file.txt");
```
&nbsp;
## Create a signed URL (Used for sharing private files)
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Returns a URL that'll work for 15 minutes for this file.
$my_space->signedURL("my-file.txt", "15 minutes");
```
&nbsp;
## Create an unsigned URL (Used for sharing public files)
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Returns a URL that'll work as long as the file is public.
$my_space->url("my-file.txt");
```
&nbsp;
## Change a file's privacy (Public & Private ACL)
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Make a file public.
$my_space->filePrivacy("my-file.txt", "public");
//Make a file private.
$my_space->filePrivacy("my-file.txt", "private");
```
&nbsp;
## Delete a file
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Deletes a single file.
$my_space->deleteFile("my-file.txt");
```
&nbsp;
## Delete an entire folder
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Deletes all content of a folder (Or any file paths that match the provided check string).
$my_space->deleteFolder("my-folder");
```
&nbsp;
## Change your Space's privacy (ACL)
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Makes your Space public. All your Space's files will be displayed to anyone.
$my_space->privacy("public");
//Makes your Space private.
$my_space->privacy("private");
```
&nbsp;
## List your Space's CORS rules
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Returns an array of your Space's CORS rules.
$my_space->getCORS();
```
* This will throw an error if no CORS rules exist.
&nbsp;
## Set your Space's CORS rules
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//This allows all sources to use your file.
$my_space->setCORS([["origins" => ["*"], "methods" => ["GET", "HEAD", "OPTIONS"]]]);
```
&nbsp;
## Destroy your Space
Also deletes all files inside your Space
```php
$my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
//Destroys your Space & deletes all its files.
$my_space->destroy();
```

BIN
aws/Aws/.DS_Store vendored

Binary file not shown.

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,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\promise_for($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,45 @@
<?php
namespace Aws\AccessAnalyzer;
use Aws\AwsClient;
/**
* This client is used to interact with the **Access Analyzer** service.
* @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 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 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 listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(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 updateArchiveRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateArchiveRuleAsync(array $args = [])
* @method \Aws\Result updateFindings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFindingsAsync(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

@ -12,6 +12,8 @@ use Aws\AwsClient;
* @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 getCertificate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getCertificateAsync(array $args = [])
* @method \Aws\Result importCertificate(array $args = [])
@ -22,9 +24,13 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listTagsForCertificateAsync(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 updateCertificateOptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateCertificateOptionsAsync(array $args = [])
*/
class AcmClient extends AwsClient {}

View file

@ -5,10 +5,32 @@ use Aws\AwsClient;
/**
* This client is used to interact with the **Alexa For Business** service.
* @method \Aws\Result approveSkill(array $args = [])
* @method \GuzzleHttp\Promise\Promise approveSkillAsync(array $args = [])
* @method \Aws\Result associateContactWithAddressBook(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateContactWithAddressBookAsync(array $args = [])
* @method \Aws\Result associateDeviceWithNetworkProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateDeviceWithNetworkProfileAsync(array $args = [])
* @method \Aws\Result associateDeviceWithRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateDeviceWithRoomAsync(array $args = [])
* @method \Aws\Result associateSkillGroupWithRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateSkillGroupWithRoomAsync(array $args = [])
* @method \Aws\Result associateSkillWithSkillGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateSkillWithSkillGroupAsync(array $args = [])
* @method \Aws\Result associateSkillWithUsers(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateSkillWithUsersAsync(array $args = [])
* @method \Aws\Result createAddressBook(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAddressBookAsync(array $args = [])
* @method \Aws\Result createBusinessReportSchedule(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBusinessReportScheduleAsync(array $args = [])
* @method \Aws\Result createConferenceProvider(array $args = [])
* @method \GuzzleHttp\Promise\Promise createConferenceProviderAsync(array $args = [])
* @method \Aws\Result createContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise createContactAsync(array $args = [])
* @method \Aws\Result createGatewayGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createGatewayGroupAsync(array $args = [])
* @method \Aws\Result createNetworkProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise createNetworkProfileAsync(array $args = [])
* @method \Aws\Result createProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise createProfileAsync(array $args = [])
* @method \Aws\Result createRoom(array $args = [])
@ -17,22 +39,64 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createSkillGroupAsync(array $args = [])
* @method \Aws\Result createUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise createUserAsync(array $args = [])
* @method \Aws\Result deleteAddressBook(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAddressBookAsync(array $args = [])
* @method \Aws\Result deleteBusinessReportSchedule(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBusinessReportScheduleAsync(array $args = [])
* @method \Aws\Result deleteConferenceProvider(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteConferenceProviderAsync(array $args = [])
* @method \Aws\Result deleteContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteContactAsync(array $args = [])
* @method \Aws\Result deleteDevice(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDeviceAsync(array $args = [])
* @method \Aws\Result deleteDeviceUsageData(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDeviceUsageDataAsync(array $args = [])
* @method \Aws\Result deleteGatewayGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteGatewayGroupAsync(array $args = [])
* @method \Aws\Result deleteNetworkProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteNetworkProfileAsync(array $args = [])
* @method \Aws\Result deleteProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProfileAsync(array $args = [])
* @method \Aws\Result deleteRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRoomAsync(array $args = [])
* @method \Aws\Result deleteRoomSkillParameter(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRoomSkillParameterAsync(array $args = [])
* @method \Aws\Result deleteSkillAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteSkillAuthorizationAsync(array $args = [])
* @method \Aws\Result deleteSkillGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteSkillGroupAsync(array $args = [])
* @method \Aws\Result deleteUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteUserAsync(array $args = [])
* @method \Aws\Result disassociateContactFromAddressBook(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateContactFromAddressBookAsync(array $args = [])
* @method \Aws\Result disassociateDeviceFromRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateDeviceFromRoomAsync(array $args = [])
* @method \Aws\Result disassociateSkillFromSkillGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateSkillFromSkillGroupAsync(array $args = [])
* @method \Aws\Result disassociateSkillFromUsers(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateSkillFromUsersAsync(array $args = [])
* @method \Aws\Result disassociateSkillGroupFromRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateSkillGroupFromRoomAsync(array $args = [])
* @method \Aws\Result forgetSmartHomeAppliances(array $args = [])
* @method \GuzzleHttp\Promise\Promise forgetSmartHomeAppliancesAsync(array $args = [])
* @method \Aws\Result getAddressBook(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAddressBookAsync(array $args = [])
* @method \Aws\Result getConferencePreference(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConferencePreferenceAsync(array $args = [])
* @method \Aws\Result getConferenceProvider(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConferenceProviderAsync(array $args = [])
* @method \Aws\Result getContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise getContactAsync(array $args = [])
* @method \Aws\Result getDevice(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeviceAsync(array $args = [])
* @method \Aws\Result getGateway(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGatewayAsync(array $args = [])
* @method \Aws\Result getGatewayGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGatewayGroupAsync(array $args = [])
* @method \Aws\Result getInvitationConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getInvitationConfigurationAsync(array $args = [])
* @method \Aws\Result getNetworkProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise getNetworkProfileAsync(array $args = [])
* @method \Aws\Result getProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProfileAsync(array $args = [])
* @method \Aws\Result getRoom(array $args = [])
@ -41,18 +105,50 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getRoomSkillParameterAsync(array $args = [])
* @method \Aws\Result getSkillGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSkillGroupAsync(array $args = [])
* @method \Aws\Result listBusinessReportSchedules(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBusinessReportSchedulesAsync(array $args = [])
* @method \Aws\Result listConferenceProviders(array $args = [])
* @method \GuzzleHttp\Promise\Promise listConferenceProvidersAsync(array $args = [])
* @method \Aws\Result listDeviceEvents(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDeviceEventsAsync(array $args = [])
* @method \Aws\Result listGatewayGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listGatewayGroupsAsync(array $args = [])
* @method \Aws\Result listGateways(array $args = [])
* @method \GuzzleHttp\Promise\Promise listGatewaysAsync(array $args = [])
* @method \Aws\Result listSkills(array $args = [])
* @method \GuzzleHttp\Promise\Promise listSkillsAsync(array $args = [])
* @method \Aws\Result listSkillsStoreCategories(array $args = [])
* @method \GuzzleHttp\Promise\Promise listSkillsStoreCategoriesAsync(array $args = [])
* @method \Aws\Result listSkillsStoreSkillsByCategory(array $args = [])
* @method \GuzzleHttp\Promise\Promise listSkillsStoreSkillsByCategoryAsync(array $args = [])
* @method \Aws\Result listSmartHomeAppliances(array $args = [])
* @method \GuzzleHttp\Promise\Promise listSmartHomeAppliancesAsync(array $args = [])
* @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result putConferencePreference(array $args = [])
* @method \GuzzleHttp\Promise\Promise putConferencePreferenceAsync(array $args = [])
* @method \Aws\Result putInvitationConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putInvitationConfigurationAsync(array $args = [])
* @method \Aws\Result putRoomSkillParameter(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRoomSkillParameterAsync(array $args = [])
* @method \Aws\Result putSkillAuthorization(array $args = [])
* @method \GuzzleHttp\Promise\Promise putSkillAuthorizationAsync(array $args = [])
* @method \Aws\Result registerAVSDevice(array $args = [])
* @method \GuzzleHttp\Promise\Promise registerAVSDeviceAsync(array $args = [])
* @method \Aws\Result rejectSkill(array $args = [])
* @method \GuzzleHttp\Promise\Promise rejectSkillAsync(array $args = [])
* @method \Aws\Result resolveRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise resolveRoomAsync(array $args = [])
* @method \Aws\Result revokeInvitation(array $args = [])
* @method \GuzzleHttp\Promise\Promise revokeInvitationAsync(array $args = [])
* @method \Aws\Result searchAddressBooks(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchAddressBooksAsync(array $args = [])
* @method \Aws\Result searchContacts(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchContactsAsync(array $args = [])
* @method \Aws\Result searchDevices(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchDevicesAsync(array $args = [])
* @method \Aws\Result searchNetworkProfiles(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchNetworkProfilesAsync(array $args = [])
* @method \Aws\Result searchProfiles(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchProfilesAsync(array $args = [])
* @method \Aws\Result searchRooms(array $args = [])
@ -61,16 +157,34 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise searchSkillGroupsAsync(array $args = [])
* @method \Aws\Result searchUsers(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchUsersAsync(array $args = [])
* @method \Aws\Result sendAnnouncement(array $args = [])
* @method \GuzzleHttp\Promise\Promise sendAnnouncementAsync(array $args = [])
* @method \Aws\Result sendInvitation(array $args = [])
* @method \GuzzleHttp\Promise\Promise sendInvitationAsync(array $args = [])
* @method \Aws\Result startDeviceSync(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDeviceSyncAsync(array $args = [])
* @method \Aws\Result startSmartHomeApplianceDiscovery(array $args = [])
* @method \GuzzleHttp\Promise\Promise startSmartHomeApplianceDiscoveryAsync(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 updateAddressBook(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAddressBookAsync(array $args = [])
* @method \Aws\Result updateBusinessReportSchedule(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBusinessReportScheduleAsync(array $args = [])
* @method \Aws\Result updateConferenceProvider(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateConferenceProviderAsync(array $args = [])
* @method \Aws\Result updateContact(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateContactAsync(array $args = [])
* @method \Aws\Result updateDevice(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDeviceAsync(array $args = [])
* @method \Aws\Result updateGateway(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateGatewayAsync(array $args = [])
* @method \Aws\Result updateGatewayGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateGatewayGroupAsync(array $args = [])
* @method \Aws\Result updateNetworkProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateNetworkProfileAsync(array $args = [])
* @method \Aws\Result updateProfile(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateProfileAsync(array $args = [])
* @method \Aws\Result updateRoom(array $args = [])

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

@ -94,7 +94,7 @@ class ApiProvider
*/
public static function defaultProvider()
{
return new self(dirname(__FILE__) . '/../data', \Aws\manifest());
return new self(__DIR__ . '/../data', \Aws\manifest());
}
/**
@ -165,7 +165,7 @@ class ApiProvider
}
/**
* Execute the the provider.
* Execute the provider.
*
* @param string $type Type of data ('api', 'waiter', 'paginator').
* @param string $service Service name.

View file

@ -1,6 +1,10 @@
<?php
namespace Aws\Api;
use Aws\Api\Parser\Exception\ParserException;
use Exception;
/**
* DateTime overrides that make DateTime work more seamlessly as a string,
* with JSON documents, and with JMESPath.
@ -9,16 +13,72 @@ class DateTimeResult extends \DateTime implements \JsonSerializable
{
/**
* 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).
* @param $unixTimestamp
*
* @return DateTimeResult
* @throws Exception
*/
public static function fromEpoch($unixTimestamp)
{
return new self(gmdate('c', $unixTimestamp));
}
/**
* @param $iso8601Timestamp
*
* @return DateTimeResult
*/
public static function fromISO8601($iso8601Timestamp)
{
if (is_numeric($iso8601Timestamp) || !is_string($iso8601Timestamp)) {
throw new ParserException('Invalid timestamp value passed to DateTimeResult::fromISO8601');
}
return new DateTimeResult($iso8601Timestamp);
}
/**
* Create a new DateTimeResult from an unknown timestamp.
*
* @param $timestamp
*
* @return DateTimeResult
* @throws ParserException|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.
*
@ -39,3 +99,4 @@ class DateTimeResult extends \DateTime implements \JsonSerializable
return (string) $this;
}
}

View file

@ -109,7 +109,7 @@ class DocModel
return '';
}
$tidy = new \Tidy();
$tidy = new \tidy();
$tidy->parseString($content, [
'indent' => true,
'doctype' => 'omit',

View file

@ -0,0 +1,95 @@
<?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 ($data['code'] == $error['name']
&& $error instanceof StructureShape
) {
$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;
}
}

View file

@ -2,6 +2,7 @@
namespace Aws\Api\ErrorParser;
use Aws\Api\Parser\PayloadParserTrait;
use Aws\Api\StructureShape;
use Psr\Http\Message\ResponseInterface;
/**
@ -20,7 +21,18 @@ trait JsonParserTrait
'code' => null,
'message' => null,
'type' => $code[0] == '4' ? 'client' : 'server',
'parsed' => $this->parseJson($response->getBody())
'parsed' => $this->parseJson($response->getBody(), $response)
];
}
protected function payload(
ResponseInterface $response,
StructureShape $member
) {
$jsonBody = $this->parseJson($response->getBody(), $response);
if ($jsonBody) {
return $this->parser->parse($member, $jsonBody);
}
}
}

View file

@ -1,18 +1,32 @@
<?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
class JsonRpcErrorParser extends AbstractErrorParser
{
use JsonParserTrait;
public function __invoke(ResponseInterface $response)
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']);
@ -26,6 +40,8 @@ class JsonRpcErrorParser
: null;
}
$this->populateShape($data, $response, $command);
return $data;
}
}

View file

@ -1,17 +1,31 @@
<?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
class RestJsonErrorParser extends AbstractErrorParser
{
use JsonParserTrait;
public function __invoke(ResponseInterface $response)
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
@ -30,6 +44,15 @@ class RestJsonErrorParser
$data['code'] = $colon ? substr($code, 0, $colon) : $code;
}
// Retrieve error message directly
$data['message'] = isset($data['parsed']['message'])
? $data['parsed']['message']
: (isset($data['parsed']['Message'])
? $data['parsed']['Message']
: null);
$this->populateShape($data, $response, $command);
return $data;
}
}

View file

@ -2,34 +2,50 @@
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
class XmlErrorParser extends AbstractErrorParser
{
use PayloadParserTrait;
public function __invoke(ResponseInterface $response)
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
'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), $data);
$this->parseBody($this->parseXml($body, $response), $data);
} else {
$this->parseHeaders($response, $data);
}
$this->populateShape($data, $response, $command);
return $data;
}
@ -51,16 +67,7 @@ class XmlErrorParser
private function parseBody(\SimpleXMLElement $body, array &$data)
{
$data['parsed'] = $body;
$namespaces = $body->getDocNamespaces();
if (!isset($namespaces[''])) {
$prefix = '';
} else {
// Account for the default namespace being defined and PHP not
// being able to handle it :(.
$body->registerXPathNamespace('ns', $namespaces['']);
$prefix = 'ns:';
}
$prefix = $this->registerNamespacePrefix($body);
if ($tempXml = $body->xpath("//{$prefix}Code[1]")) {
$data['code'] = (string) $tempXml[0];
@ -71,12 +78,34 @@ class XmlErrorParser
}
$tempXml = $body->xpath("//{$prefix}RequestId[1]");
if (empty($tempXml)) {
$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 '';
}
if (isset($tempXml[0])) {
$data['request_id'] = (string) $tempXml[0];
// 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

@ -2,9 +2,11 @@
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
@ -14,6 +16,9 @@ abstract class AbstractParser
/** @var \Aws\Api\Service Representation of the service API*/
protected $api;
/** @var callable */
protected $parser;
/**
* @param Service $api Service description.
*/
@ -32,4 +37,10 @@ abstract class AbstractParser
CommandInterface $command,
ResponseInterface $response
);
abstract public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
);
}

View file

@ -14,6 +14,7 @@ use Psr\Http\Message\ResponseInterface;
abstract class AbstractRestParser extends AbstractParser
{
use PayloadParserTrait;
/**
* Parses a payload from a response.
*
@ -73,7 +74,13 @@ abstract class AbstractRestParser extends AbstractParser
) {
$member = $output->getMember($payload);
if ($member instanceof StructureShape) {
if (!empty($member['eventstream'])) {
$result[$payload] = new EventParsingIterator(
$response->getBody(),
$member,
$this
);
} else if ($member instanceof StructureShape) {
// Structure members parse top-level data into a specific key.
$result[$payload] = [];
$this->payload($response, $member, $result[$payload]);
@ -110,7 +117,10 @@ abstract class AbstractRestParser extends AbstractParser
break;
case 'timestamp':
try {
$value = new DateTimeResult($value);
$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
@ -118,10 +128,21 @@ abstract class AbstractRestParser extends AbstractParser
return;
}
case 'string':
if ($shape['jsonvalue']) {
$value = $this->parseJson(base64_decode($value));
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;
}
break;
}
$result[$name] = $value;

View file

@ -1,9 +1,11 @@
<?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;
/**
@ -11,9 +13,6 @@ use GuzzleHttp\Psr7;
*/
class Crc32ValidatingParser extends AbstractParser
{
/** @var callable */
private $parser;
/**
* @param callable $parser Parser to wrap.
*/
@ -44,4 +43,12 @@ class Crc32ValidatingParser extends AbstractParser
$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,335 @@
<?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. */
private $stream;
/** @var array Currently parsed event. */
private $currentEvent;
/** @var int Current in-order event key. */
private $key;
/** @var resource|\HashContext CRC32 hash context for event validation */
private $hashContext;
/** @var int $currentPosition */
private $currentPosition;
/**
* DecodingEventStreamIterator constructor.
*
* @param StreamInterface $stream
*/
public function __construct(StreamInterface $stream)
{
$this->stream = $stream;
$this->rewind();
}
private 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];
}
private 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];
}
private 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\stream_for(
$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
*/
public function current()
{
return $this->currentEvent;
}
/**
* @return int
*/
public function key()
{
return $this->key;
}
public function next()
{
$this->currentPosition = $this->stream->tell();
if ($this->valid()) {
$this->key++;
$this->currentEvent = $this->parseEvent();
}
}
public function rewind()
{
$this->stream->rewind();
$this->key = 0;
$this->currentPosition = 0;
$this->currentEvent = $this->parseEvent();
}
/**
* @return bool
*/
public function valid()
{
return $this->currentPosition < $this->stream->getSize();
}
// Decoding Utilities
private 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)
{
if (version_compare(PHP_VERSION, '5.6.3', '<')) {
$d = unpack('N2', $bytes);
return [1 => $d[1] << 32 | $d[2]];
}
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,107 @@
<?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 = new DecodingEventStreamIterator($stream);
$this->shape = $shape;
$this->parser = $parser;
}
public function current()
{
return $this->parseEvent($this->decodingIterator->current());
}
public function key()
{
return $this->decodingIterator->key();
}
public function next()
{
$this->decodingIterator->next();
}
public function rewind()
{
$this->decodingIterator->rewind();
}
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'] !== 'event') {
throw new ParserException('Failed to parse unknown message type.');
}
}
if (empty($event['headers'][':event-type'])) {
throw new ParserException('Failed to parse without event type.');
}
$eventShape = $this->shape->getMember($event['headers'][':event-type']);
$parsedEvent = [];
foreach ($eventShape['members'] as $shape => $details) {
if (!empty($details['eventpayload'])) {
$payloadShape = $eventShape->getMember($shape);
if ($payloadShape['type'] === 'blob') {
$parsedEvent[$shape] = $event['payload'];
} else {
$parsedEvent[$shape] = $this->parser->parseMemberFromStream(
$event['payload'],
$payloadShape,
null
);
}
} else {
$parsedEvent[$shape] = $event['headers'][$shape];
}
}
return [
$event['headers'][':event-type'] => $parsedEvent
];
}
private function parseError(array $event)
{
throw new EventStreamDataException(
$event['headers'][':error-code'],
$event['headers'][':error-message']
);
}
}

View file

@ -1,4 +1,56 @@
<?php
namespace Aws\Api\Parser\Exception;
class ParserException extends \RuntimeException {}
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

@ -43,10 +43,10 @@ class JsonParser
return $target;
case '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::fromEpoch($value);
return DateTimeResult::fromTimestamp(
$value,
!empty($shape['timestampFormat']) ? $shape['timestampFormat'] : null
);
case 'blob':
return base64_decode($value);
@ -56,3 +56,4 @@ class JsonParser
}
}
}

View file

@ -1,10 +1,12 @@
<?php
namespace Aws\Api\Parser;
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)
@ -13,8 +15,6 @@ class JsonRpcParser extends AbstractParser
{
use PayloadParserTrait;
private $parser;
/**
* @param Service $api Service description
* @param JsonParser $parser JSON body builder
@ -32,11 +32,20 @@ class JsonRpcParser extends AbstractParser
$operation = $this->api->getOperation($command->getName());
$result = null === $operation['output']
? null
: $this->parser->parse(
: $this->parseMemberFromStream(
$response->getBody(),
$operation->getOutput(),
$this->parseJson($response->getBody())
$response
);
return new Result($result ?: []);
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
return $this->parser->parse($member, $this->parseJson($stream, $response));
}
}

View file

@ -0,0 +1,90 @@
<?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);
switch ($shape->getType()) {
case 'float':
case 'double':
$value = (float) $value;
break;
case 'long':
$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

@ -2,6 +2,7 @@
namespace Aws\Api\Parser;
use Aws\Api\Parser\Exception\ParserException;
use Psr\Http\Message\ResponseInterface;
trait PayloadParserTrait
{
@ -12,13 +13,17 @@ trait PayloadParserTrait
*
* @return array
*/
private function parseJson($json)
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());
throw new ParserException(
'Error parsing JSON: ' . json_last_error_msg(),
0,
null,
['response' => $response]
);
}
return $jsonPayload;
@ -31,7 +36,7 @@ trait PayloadParserTrait
*
* @return \SimpleXMLElement
*/
private function parseXml($xml)
protected function parseXml($xml, $response)
{
$priorSetting = libxml_use_internal_errors(true);
try {
@ -41,7 +46,12 @@ trait PayloadParserTrait
throw new \RuntimeException($error->message);
}
} catch (\Exception $e) {
throw new ParserException("Error parsing XML: {$e->getMessage()}", 0, $e);
throw new ParserException(
"Error parsing XML: {$e->getMessage()}",
0,
$e,
['response' => $response]
);
} finally {
libxml_use_internal_errors($priorSetting);
}

View file

@ -2,9 +2,11 @@
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)
@ -13,9 +15,6 @@ class QueryParser extends AbstractParser
{
use PayloadParserTrait;
/** @var XmlParser */
private $xmlParser;
/** @var bool */
private $honorResultWrapper;
@ -32,7 +31,7 @@ class QueryParser extends AbstractParser
$honorResultWrapper = true
) {
parent::__construct($api);
$this->xmlParser = $xmlParser ?: new XmlParser();
$this->parser = $xmlParser ?: new XmlParser();
$this->honorResultWrapper = $honorResultWrapper;
}
@ -41,12 +40,21 @@ class QueryParser extends AbstractParser
ResponseInterface $response
) {
$output = $this->api->getOperation($command->getName())->getOutput();
$xml = $this->parseXml($response->getBody());
$xml = $this->parseXml($response->getBody(), $response);
if ($this->honorResultWrapper && $output['resultWrapper']) {
$xml = $xml->{$output['resultWrapper']};
}
return new Result($this->xmlParser->parse($output, $xml));
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

@ -4,6 +4,7 @@ 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)
@ -12,9 +13,6 @@ class RestJsonParser extends AbstractRestParser
{
use PayloadParserTrait;
/** @var JsonParser */
private $parser;
/**
* @param Service $api Service description
* @param JsonParser $parser JSON body builder
@ -30,10 +28,22 @@ class RestJsonParser extends AbstractRestParser
StructureShape $member,
array &$result
) {
$jsonBody = $this->parseJson($response->getBody());
$jsonBody = $this->parseJson($response->getBody(), $response);
if ($jsonBody) {
$result += $this->parser->parse($member, $jsonBody);
}
}
public function parseMemberFromStream(
StreamInterface $stream,
StructureShape $member,
$response
) {
$jsonBody = $this->parseJson($stream, $response);
if ($jsonBody) {
return $this->parser->parse($member, $jsonBody);
}
return [];
}
}

View file

@ -4,6 +4,7 @@ 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...)
@ -12,9 +13,6 @@ class RestXmlParser extends AbstractRestParser
{
use PayloadParserTrait;
/** @var XmlParser */
private $parser;
/**
* @param Service $api Service description
* @param XmlParser $parser XML body parser
@ -30,7 +28,15 @@ class RestXmlParser extends AbstractRestParser
StructureShape $member,
array &$result
) {
$xml = $this->parseXml($response->getBody());
$result += $this->parser->parse($member, $xml);
$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

@ -4,6 +4,7 @@ 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;
@ -50,6 +51,15 @@ class XmlParser
$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
);
}
}
}
@ -124,11 +134,38 @@ class XmlParser
private function parse_boolean(Shape $shape, $value)
{
return $value == 'true' ? true : false;
return $value == 'true';
}
private function parse_timestamp(Shape $shape, $value)
{
return new DateTimeResult($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']
? $shape['xmlNamespace']['uri']
: '';
$prefix = $shape['xmlNamespace']['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

@ -58,6 +58,9 @@ class JsonBody
= $this->format($valueShape, $v);
}
}
if (empty($data)) {
return new \stdClass;
}
return $data;
case 'list':
@ -81,7 +84,10 @@ class JsonBody
return base64_encode($value);
case 'timestamp':
return TimestampShape::format($value, 'unixTimestamp');
$timestampFormat = !empty($shape['timestampFormat'])
? $shape['timestampFormat']
: 'unixTimestamp';
return TimestampShape::format($value, $timestampFormat);
default:
return $value;

View file

@ -144,7 +144,10 @@ class QueryParamBuilder
$prefix,
array &$query
) {
$query[$prefix] = TimestampShape::format($value, 'iso8601');
$timestampFormat = !empty($shape['timestampFormat'])
? $shape['timestampFormat']
: 'iso8601';
$query[$prefix] = TimestampShape::format($value, $timestampFormat);
}
protected function format_boolean(Shape $shape, $value, $prefix, array &$query)

View file

@ -27,7 +27,7 @@ class RestJsonSerializer extends RestSerializer
JsonBody $jsonFormatter = null
) {
parent::__construct($api, $endpoint);
$this->contentType = JsonBody::getContentType($api);
$this->contentType = 'application/json';
$this->jsonFormatter = $jsonFormatter ?: new JsonBody($api);
}

View file

@ -123,8 +123,11 @@ abstract class RestSerializer
private function applyHeader($name, Shape $member, $value, array &$opts)
{
if ($member->getType() == 'timestamp') {
$value = TimestampShape::format($value, 'rfc822');
if ($member->getType() === 'timestamp') {
$timestampFormat = !empty($member['timestampFormat'])
? $member['timestampFormat']
: 'rfc822';
$value = TimestampShape::format($value, $timestampFormat);
}
if ($member['jsonvalue']) {
$value = json_encode($value);
@ -157,8 +160,14 @@ abstract class RestSerializer
? $opts['query'] + $value
: $value;
} elseif ($value !== null) {
if ($member->getType() === 'boolean') {
$type = $member->getType();
if ($type === 'boolean') {
$value = $value ? 'true' : 'false';
} elseif ($type === 'timestamp') {
$timestampFormat = !empty($member['timestampFormat'])
? $member['timestampFormat']
: 'iso8601';
$value = TimestampShape::format($value, $timestampFormat);
}
$opts['query'][$member['locationName'] ?: $name] = $value;
@ -186,11 +195,13 @@ abstract class RestSerializer
$k = $isGreedy ? substr($matches[1], 0, -1) : $matches[1];
if (!isset($varspecs[$k])) {
return '';
} elseif ($isGreedy) {
return str_replace('%2F', '/', rawurlencode($varspecs[$k]));
} else {
return rawurlencode($varspecs[$k]);
}
if ($isGreedy) {
return str_replace('%2F', '/', rawurlencode($varspecs[$k]));
}
return rawurlencode($varspecs[$k]);
},
$operation['http']['requestUri']
);
@ -201,6 +212,12 @@ abstract class RestSerializer
$relative .= strpos($relative, '?') ? "&{$append}" : "?$append";
}
// If endpoint has path, remove leading '/' to preserve URI resolution.
$path = $this->endpoint->getPath();
if ($path && $relative[0] === '/') {
$relative = substr($relative, 1);
}
// Expand path place holders using Amazon's slightly different URI
// template syntax.
return UriResolver::resolve($this->endpoint, new Uri($relative));

View file

@ -80,7 +80,7 @@ class XmlBody
private function defaultShape(Shape $shape, $name, $value, XMLWriter $xml)
{
$this->startElement($shape, $name, $xml);
$xml->writeRaw($value);
$xml->text($value);
$xml->endElement();
}
@ -187,7 +187,10 @@ class XmlBody
XMLWriter $xml
) {
$this->startElement($shape, $name, $xml);
$xml->writeRaw(TimestampShape::format($value, 'iso8601'));
$timestampFormat = !empty($shape['timestampFormat'])
? $shape['timestampFormat']
: 'iso8601';
$xml->writeRaw(TimestampShape::format($value, $timestampFormat));
$xml->endElement();
}

View file

@ -43,6 +43,7 @@ class Service extends AbstractModel
], $defaultMeta = [
'apiVersion' => null,
'serviceFullName' => null,
'serviceId' => null,
'endpointPrefix' => null,
'signingName' => null,
'signatureVersion' => null,
@ -87,7 +88,9 @@ class Service extends AbstractModel
if (isset($mapping[$proto])) {
return new $mapping[$proto]($api, $endpoint);
} elseif ($proto == 'ec2') {
}
if ($proto == 'ec2') {
return new QuerySerializer($api, $endpoint, new Ec2ParamBuilder());
}
@ -99,12 +102,14 @@ class Service extends AbstractModel
/**
* 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)
public static function createErrorParser($protocol, Service $api = null)
{
static $mapping = [
'json' => 'Aws\Api\ErrorParser\JsonRpcErrorParser',
@ -115,7 +120,7 @@ class Service extends AbstractModel
];
if (isset($mapping[$protocol])) {
return new $mapping[$protocol]();
return new $mapping[$protocol]($api);
}
throw new \UnexpectedValueException("Unknown protocol: $protocol");
@ -140,7 +145,9 @@ class Service extends AbstractModel
$proto = $api->getProtocol();
if (isset($mapping[$proto])) {
return new $mapping[$proto]($api);
} elseif ($proto == 'ec2') {
}
if ($proto == 'ec2') {
return new QueryParser($api, null, false);
}
@ -159,6 +166,16 @@ class Service extends AbstractModel
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
*
@ -282,6 +299,24 @@ class Service extends AbstractModel
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.
*
@ -293,7 +328,9 @@ class Service extends AbstractModel
{
if (!$key) {
return $this['metadata'];
} elseif (isset($this->definition['metadata'][$key])) {
}
if (isset($this->definition['metadata'][$key])) {
return $this->definition['metadata'][$key];
}

View file

@ -53,7 +53,9 @@ class ShapeMap
$definition = $shapeRef + $this->definitions[$shape];
$definition['name'] = $definition['shape'];
unset($definition['shape']);
if (isset($definition['shape'])) {
unset($definition['shape']);
}
$result = Shape::create($definition, $this);

View file

@ -249,7 +249,20 @@ class Validator
private function checkAssociativeArray($value)
{
if (!is_array($value) || isset($value[0])) {
$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;

View file

@ -162,6 +162,8 @@ use Psr\Http\Message\RequestInterface;
* @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 = [])
@ -194,10 +196,14 @@ use Psr\Http\Message\RequestInterface;
* @method \GuzzleHttp\Promise\Promise putMethodResponseAsync(array $args = [])
* @method \Aws\Result putRestApi(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRestApiAsync(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 = [])

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,153 @@
<?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 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 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 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 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,75 @@
<?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 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 deleteHostedConfigurationVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteHostedConfigurationVersionAsync(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 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 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 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 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,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

@ -5,28 +5,42 @@ use Aws\AwsClient;
/**
* This client is used to interact with the **AWS AppSync** service.
* @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 createDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataSourceAsync(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 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 deleteDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataSourceAsync(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 flushApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise flushApiCacheAsync(array $args = [])
* @method \Aws\Result getApiCache(array $args = [])
* @method \GuzzleHttp\Promise\Promise getApiCacheAsync(array $args = [])
* @method \Aws\Result getDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataSourceAsync(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 getIntrospectionSchema(array $args = [])
@ -41,16 +55,32 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listApiKeysAsync(array $args = [])
* @method \Aws\Result listDataSources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataSourcesAsync(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 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 startSchemaCreation(array $args = [])
* @method \GuzzleHttp\Promise\Promise startSchemaCreationAsync(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 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 updateDataSource(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataSourceAsync(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 = [])

View file

@ -0,0 +1,45 @@
<?php
namespace Aws\Appflow;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Appflow** service.
* @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 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 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 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 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 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

@ -7,6 +7,8 @@ use Aws\AwsClient;
* This client is used to interact with the **AWS Application Discovery Service** service.
* @method \Aws\Result associateConfigurationItemsToApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateConfigurationItemsToApplicationAsync(array $args = [])
* @method \Aws\Result batchDeleteImportData(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeleteImportDataAsync(array $args = [])
* @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createTags(array $args = [])
@ -19,10 +21,14 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeAgentsAsync(array $args = [])
* @method \Aws\Result describeConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeConfigurationsAsync(array $args = [])
* @method \Aws\Result describeContinuousExports(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeContinuousExportsAsync(array $args = [])
* @method \Aws\Result describeExportConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeExportConfigurationsAsync(array $args = [])
* @method \Aws\Result describeExportTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeExportTasksAsync(array $args = [])
* @method \Aws\Result describeImportTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeImportTasksAsync(array $args = [])
* @method \Aws\Result describeTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeTagsAsync(array $args = [])
* @method \Aws\Result disassociateConfigurationItemsFromApplication(array $args = [])
@ -35,10 +41,16 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listConfigurationsAsync(array $args = [])
* @method \Aws\Result listServerNeighbors(array $args = [])
* @method \GuzzleHttp\Promise\Promise listServerNeighborsAsync(array $args = [])
* @method \Aws\Result startContinuousExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise startContinuousExportAsync(array $args = [])
* @method \Aws\Result startDataCollectionByAgentIds(array $args = [])
* @method \GuzzleHttp\Promise\Promise startDataCollectionByAgentIdsAsync(array $args = [])
* @method \Aws\Result startExportTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise startExportTaskAsync(array $args = [])
* @method \Aws\Result startImportTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise startImportTaskAsync(array $args = [])
* @method \Aws\Result stopContinuousExport(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopContinuousExportAsync(array $args = [])
* @method \Aws\Result stopDataCollectionByAgentIds(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopDataCollectionByAgentIdsAsync(array $args = [])
* @method \Aws\Result updateApplication(array $args = [])

View file

@ -0,0 +1,63 @@
<?php
namespace Aws\ApplicationInsights;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon CloudWatch Application Insights** service.
* @method \Aws\Result createApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise createApplicationAsync(array $args = [])
* @method \Aws\Result createComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise createComponentAsync(array $args = [])
* @method \Aws\Result createLogPattern(array $args = [])
* @method \GuzzleHttp\Promise\Promise createLogPatternAsync(array $args = [])
* @method \Aws\Result deleteApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteApplicationAsync(array $args = [])
* @method \Aws\Result deleteComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteComponentAsync(array $args = [])
* @method \Aws\Result deleteLogPattern(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteLogPatternAsync(array $args = [])
* @method \Aws\Result describeApplication(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeApplicationAsync(array $args = [])
* @method \Aws\Result describeComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeComponentAsync(array $args = [])
* @method \Aws\Result describeComponentConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeComponentConfigurationAsync(array $args = [])
* @method \Aws\Result describeComponentConfigurationRecommendation(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeComponentConfigurationRecommendationAsync(array $args = [])
* @method \Aws\Result describeLogPattern(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeLogPatternAsync(array $args = [])
* @method \Aws\Result describeObservation(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeObservationAsync(array $args = [])
* @method \Aws\Result describeProblem(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeProblemAsync(array $args = [])
* @method \Aws\Result describeProblemObservations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeProblemObservationsAsync(array $args = [])
* @method \Aws\Result listApplications(array $args = [])
* @method \GuzzleHttp\Promise\Promise listApplicationsAsync(array $args = [])
* @method \Aws\Result listComponents(array $args = [])
* @method \GuzzleHttp\Promise\Promise listComponentsAsync(array $args = [])
* @method \Aws\Result listConfigurationHistory(array $args = [])
* @method \GuzzleHttp\Promise\Promise listConfigurationHistoryAsync(array $args = [])
* @method \Aws\Result listLogPatternSets(array $args = [])
* @method \GuzzleHttp\Promise\Promise listLogPatternSetsAsync(array $args = [])
* @method \Aws\Result listLogPatterns(array $args = [])
* @method \GuzzleHttp\Promise\Promise listLogPatternsAsync(array $args = [])
* @method \Aws\Result listProblems(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProblemsAsync(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 updateComponent(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateComponentAsync(array $args = [])
* @method \Aws\Result updateComponentConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateComponentConfigurationAsync(array $args = [])
* @method \Aws\Result updateLogPattern(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateLogPatternAsync(array $args = [])
*/
class ApplicationInsightsClient extends AwsClient {}

View file

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

View file

@ -7,6 +7,12 @@ use Aws\AwsClient;
* This client is used to interact with the **Amazon AppStream** service.
* @method \Aws\Result associateFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateFleetAsync(array $args = [])
* @method \Aws\Result batchAssociateUserStack(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchAssociateUserStackAsync(array $args = [])
* @method \Aws\Result batchDisassociateUserStack(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDisassociateUserStackAsync(array $args = [])
* @method \Aws\Result copyImage(array $args = [])
* @method \GuzzleHttp\Promise\Promise copyImageAsync(array $args = [])
* @method \Aws\Result createDirectoryConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDirectoryConfigAsync(array $args = [])
* @method \Aws\Result createFleet(array $args = [])
@ -19,6 +25,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise createStackAsync(array $args = [])
* @method \Aws\Result createStreamingURL(array $args = [])
* @method \GuzzleHttp\Promise\Promise createStreamingURLAsync(array $args = [])
* @method \Aws\Result createUsageReportSubscription(array $args = [])
* @method \GuzzleHttp\Promise\Promise createUsageReportSubscriptionAsync(array $args = [])
* @method \Aws\Result createUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise createUserAsync(array $args = [])
* @method \Aws\Result deleteDirectoryConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDirectoryConfigAsync(array $args = [])
* @method \Aws\Result deleteFleet(array $args = [])
@ -27,28 +37,48 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteImageAsync(array $args = [])
* @method \Aws\Result deleteImageBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteImageBuilderAsync(array $args = [])
* @method \Aws\Result deleteImagePermissions(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteImagePermissionsAsync(array $args = [])
* @method \Aws\Result deleteStack(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteStackAsync(array $args = [])
* @method \Aws\Result deleteUsageReportSubscription(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteUsageReportSubscriptionAsync(array $args = [])
* @method \Aws\Result deleteUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteUserAsync(array $args = [])
* @method \Aws\Result describeDirectoryConfigs(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeDirectoryConfigsAsync(array $args = [])
* @method \Aws\Result describeFleets(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeFleetsAsync(array $args = [])
* @method \Aws\Result describeImageBuilders(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeImageBuildersAsync(array $args = [])
* @method \Aws\Result describeImagePermissions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeImagePermissionsAsync(array $args = [])
* @method \Aws\Result describeImages(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeImagesAsync(array $args = [])
* @method \Aws\Result describeSessions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeSessionsAsync(array $args = [])
* @method \Aws\Result describeStacks(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStacksAsync(array $args = [])
* @method \Aws\Result describeUsageReportSubscriptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeUsageReportSubscriptionsAsync(array $args = [])
* @method \Aws\Result describeUserStackAssociations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeUserStackAssociationsAsync(array $args = [])
* @method \Aws\Result describeUsers(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeUsersAsync(array $args = [])
* @method \Aws\Result disableUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise disableUserAsync(array $args = [])
* @method \Aws\Result disassociateFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateFleetAsync(array $args = [])
* @method \Aws\Result enableUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise enableUserAsync(array $args = [])
* @method \Aws\Result expireSession(array $args = [])
* @method \GuzzleHttp\Promise\Promise expireSessionAsync(array $args = [])
* @method \Aws\Result listAssociatedFleets(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAssociatedFleetsAsync(array $args = [])
* @method \Aws\Result listAssociatedStacks(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAssociatedStacksAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result startFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise startFleetAsync(array $args = [])
* @method \Aws\Result startImageBuilder(array $args = [])
@ -57,10 +87,16 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise stopFleetAsync(array $args = [])
* @method \Aws\Result stopImageBuilder(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopImageBuilderAsync(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 updateDirectoryConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDirectoryConfigAsync(array $args = [])
* @method \Aws\Result updateFleet(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFleetAsync(array $args = [])
* @method \Aws\Result updateImagePermissions(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateImagePermissionsAsync(array $args = [])
* @method \Aws\Result updateStack(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateStackAsync(array $args = [])
*/

View file

@ -0,0 +1,82 @@
<?php
namespace Aws\Arn;
use Aws\Arn\Exception\InvalidArnException;
/**
* @internal
*/
class AccessPointArn extends Arn implements ArnInterface
{
use ResourceTypeAndIdTrait;
/**
* AccessPointArn constructor
*
* @param $data
*/
public function __construct($data)
{
parent::__construct($data);
static::validate($this->data);
}
public static function parse($string)
{
$data = parent::parse($string);
return self::parseResourceTypeAndId($data);
}
/**
* Validation specific to AccessPointArn
*
* @param array $data
*/
protected static function validate(array $data)
{
if (empty($data['region'])) {
throw new InvalidArnException("The 4th component of an access point ARN"
. " represents the region and must not be empty.");
}
if (empty($data['account_id'])) {
throw new InvalidArnException("The 5th component of an access point ARN"
. " represents the account ID and must not be empty.");
}
if (!self::isValidHostLabel($data['account_id'])) {
throw new InvalidArnException("The account ID in an access point ARN"
. " must be a valid host label value.");
}
if ($data['resource_type'] !== 'accesspoint') {
throw new InvalidArnException("The 6th component of an access point ARN"
. " represents the resource type and must be 'accesspoint'.");
}
if (empty($data['resource_id'])) {
throw new InvalidArnException("The 7th component of an access point ARN"
. " represents the resource ID and must not be empty.");
}
if (strpos($data['resource_id'], ':') !== false) {
throw new InvalidArnException("The resource ID component of an access"
. " point ARN must not contain additional components"
. " (delimited by ':').");
}
if (!self::isValidHostLabel($data['resource_id'])) {
throw new InvalidArnException("The resource ID in an access point ARN"
. " must be a valid host label value.");
}
}
protected static function isValidHostLabel($string)
{
$length = strlen($string);
if ($length < 1 || $length > 63) {
return false;
}
if ($value = preg_match("/^[a-zA-Z0-9-]+$/", $string)) {
return true;
}
return false;
}
}

154
aws/Aws/Arn/Arn.php Normal file
View file

@ -0,0 +1,154 @@
<?php
namespace Aws\Arn;
use Aws\Arn\Exception\InvalidArnException;
/**
* Amazon Resource Names (ARNs) uniquely identify AWS resources. The Arn class
* parses and stores a generic ARN object representation that can apply to any
* service resource.
*
* @internal
*/
class Arn implements ArnInterface
{
protected $data;
protected $string;
public static function parse($string)
{
$data = [
'arn' => null,
'partition' => null,
'service' => null,
'region' => null,
'account_id' => null,
'resource' => null,
];
$length = strlen($string);
$lastDelim = 0;
$numComponents = 0;
for ($i = 0; $i < $length; $i++) {
if (($numComponents < 5 && $string[$i] === ':')) {
// Split components between delimiters
$data[key($data)] = substr($string, $lastDelim, $i - $lastDelim);
// Do not include delimiter character itself
$lastDelim = $i + 1;
next($data);
$numComponents++;
}
if ($i === $length - 1) {
// Put the remainder in the last component.
if (in_array($numComponents, [5])) {
$data['resource'] = substr($string, $lastDelim);
} else {
// If there are < 5 components, put remainder in current
// component.
$data[key($data)] = substr($string, $lastDelim);
}
}
}
return $data;
}
public function __construct($data)
{
if (is_array($data)) {
$this->data = $data;
} elseif (is_string($data)) {
$this->data = static::parse($data);
} else {
throw new InvalidArnException('Constructor accepts a string or an'
. ' array as an argument.');
}
self::validate($this->data);
}
public function __toString()
{
if (!isset($this->string)) {
$components = [
$this->getPrefix(),
$this->getPartition(),
$this->getService(),
$this->getRegion(),
$this->getAccountId(),
$this->getResource(),
];
$this->string = implode(':', $components);
}
return $this->string;
}
public function getPrefix()
{
return $this->data['arn'];
}
public function getPartition()
{
return $this->data['partition'];
}
public function getService()
{
return $this->data['service'];
}
public function getRegion()
{
return $this->data['region'];
}
public function getAccountId()
{
return $this->data['account_id'];
}
public function getResource()
{
return $this->data['resource'];
}
public function toArray()
{
return $this->data;
}
/**
* Minimally restrictive generic ARN validation
*
* @param array $data
*/
protected static function validate(array $data)
{
if ($data['arn'] !== 'arn') {
throw new InvalidArnException("The 1st component of an ARN must be"
. " 'arn'.");
}
if (empty($data['partition'])) {
throw new InvalidArnException("The 2nd component of an ARN"
. " represents the partition and must not be empty.");
}
if (empty($data['service'])) {
throw new InvalidArnException("The 3rd component of an ARN"
. " represents the service and must not be empty.");
}
if (empty($data['resource'])) {
throw new InvalidArnException("The 6th component of an ARN"
. " represents the resource information and must not be empty."
. " Individual service ARNs may include additional delimiters"
. " to further qualify resources.");
}
}
}

View file

@ -0,0 +1,37 @@
<?php
namespace Aws\Arn;
/**
* Amazon Resource Names (ARNs) uniquely identify AWS resources. Classes
* implementing ArnInterface parse and store an ARN object representation.
*
* Valid ARN formats include:
*
* arn:partition:service:region:account-id:resource-id
* arn:partition:service:region:account-id:resource-type/resource-id
* arn:partition:service:region:account-id:resource-type:resource-id
*
* Some components may be omitted, depending on the service and resource type.
*
* @internal
*/
interface ArnInterface
{
public static function parse($string);
public function __toString();
public function getPrefix();
public function getPartition();
public function getService();
public function getRegion();
public function getAccountId();
public function getResource();
public function toArray();
}

41
aws/Aws/Arn/ArnParser.php Normal file
View file

@ -0,0 +1,41 @@
<?php
namespace Aws\Arn;
use Aws\Arn\S3\AccessPointArn as S3AccessPointArn;
use Aws\Arn\S3\BucketArn;
/**
* @internal
*/
class ArnParser
{
/**
* @param $string
* @return bool
*/
public static function isArn($string)
{
return strpos($string, 'arn:') === 0;
}
/**
* Parses a string and returns an instance of ArnInterface. Returns a
* specific type of Arn object if it has a specific class representation
* or a generic Arn object if not.
*
* @param $string
* @return ArnInterface
*/
public static function parse($string)
{
$data = Arn::parse($string);
if (substr($data['resource'], 0, 11) === 'accesspoint') {
if ($data['service'] === 's3') {
return new S3AccessPointArn($string);
}
return new AccessPointArn($string);
}
return new Arn($data);
}
}

View file

@ -0,0 +1,7 @@
<?php
namespace Aws\Arn\Exception;
/**
* Represents a failed attempt to construct an Arn
*/
class InvalidArnException extends \RuntimeException {}

View file

@ -0,0 +1,34 @@
<?php
namespace Aws\Arn;
/**
* @internal
*/
trait ResourceTypeAndIdTrait
{
public function getResourceType()
{
return $this->data['resource_type'];
}
public function getResourceId()
{
return $this->data['resource_id'];
}
private static function parseResourceTypeAndId(array $data)
{
$data['resource_type'] = null;
$data['resource_id'] = null;
$length = strlen($data['resource']);
for ($i = 0; $i < $length; $i++) {
if (in_array($data['resource'][$i], ['/', ':'])) {
$data['resource_type'] = substr($data['resource'], 0, $i);
$data['resource_id'] = substr($data['resource'], $i + 1);
break;
}
}
return $data;
}
}

View file

@ -0,0 +1,26 @@
<?php
namespace Aws\Arn\S3;
use Aws\Arn\AccessPointArn as BaseAccessPointArn;
use Aws\Arn\ArnInterface;
use Aws\Arn\Exception\InvalidArnException;
/**
* @internal
*/
class AccessPointArn extends BaseAccessPointArn implements ArnInterface
{
/**
* Validation specific to AccessPointArn
*
* @param array $data
*/
protected static function validate(array $data)
{
parent::validate($data);
if ($data['service'] !== 's3') {
throw new InvalidArnException("The 3rd component of an S3 access"
. " point ARN represents the region and must be 's3'.");
}
}
}

View file

@ -9,23 +9,57 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise batchGetNamedQueryAsync(array $args = [])
* @method \Aws\Result batchGetQueryExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchGetQueryExecutionAsync(array $args = [])
* @method \Aws\Result createDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise createDataCatalogAsync(array $args = [])
* @method \Aws\Result createNamedQuery(array $args = [])
* @method \GuzzleHttp\Promise\Promise createNamedQueryAsync(array $args = [])
* @method \Aws\Result createWorkGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createWorkGroupAsync(array $args = [])
* @method \Aws\Result deleteDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDataCatalogAsync(array $args = [])
* @method \Aws\Result deleteNamedQuery(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteNamedQueryAsync(array $args = [])
* @method \Aws\Result deleteWorkGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteWorkGroupAsync(array $args = [])
* @method \Aws\Result getDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDataCatalogAsync(array $args = [])
* @method \Aws\Result getDatabase(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDatabaseAsync(array $args = [])
* @method \Aws\Result getNamedQuery(array $args = [])
* @method \GuzzleHttp\Promise\Promise getNamedQueryAsync(array $args = [])
* @method \Aws\Result getQueryExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise getQueryExecutionAsync(array $args = [])
* @method \Aws\Result getQueryResults(array $args = [])
* @method \GuzzleHttp\Promise\Promise getQueryResultsAsync(array $args = [])
* @method \Aws\Result getTableMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTableMetadataAsync(array $args = [])
* @method \Aws\Result getWorkGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getWorkGroupAsync(array $args = [])
* @method \Aws\Result listDataCatalogs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDataCatalogsAsync(array $args = [])
* @method \Aws\Result listDatabases(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDatabasesAsync(array $args = [])
* @method \Aws\Result listNamedQueries(array $args = [])
* @method \GuzzleHttp\Promise\Promise listNamedQueriesAsync(array $args = [])
* @method \Aws\Result listQueryExecutions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listQueryExecutionsAsync(array $args = [])
* @method \Aws\Result listTableMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTableMetadataAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listWorkGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listWorkGroupsAsync(array $args = [])
* @method \Aws\Result startQueryExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise startQueryExecutionAsync(array $args = [])
* @method \Aws\Result stopQueryExecution(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopQueryExecutionAsync(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 updateDataCatalog(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDataCatalogAsync(array $args = [])
* @method \Aws\Result updateWorkGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateWorkGroupAsync(array $args = [])
*/
class AthenaClient extends AwsClient {}

View file

@ -0,0 +1,19 @@
<?php
namespace Aws\AugmentedAIRuntime;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Augmented AI Runtime** service.
* @method \Aws\Result deleteHumanLoop(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteHumanLoopAsync(array $args = [])
* @method \Aws\Result describeHumanLoop(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeHumanLoopAsync(array $args = [])
* @method \Aws\Result listHumanLoops(array $args = [])
* @method \GuzzleHttp\Promise\Promise listHumanLoopsAsync(array $args = [])
* @method \Aws\Result startHumanLoop(array $args = [])
* @method \GuzzleHttp\Promise\Promise startHumanLoopAsync(array $args = [])
* @method \Aws\Result stopHumanLoop(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopHumanLoopAsync(array $args = [])
*/
class AugmentedAIRuntimeClient extends AwsClient {}

View file

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

View file

@ -12,6 +12,12 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise attachLoadBalancerTargetGroupsAsync(array $args = [])
* @method \Aws\Result attachLoadBalancers(array $args = [])
* @method \GuzzleHttp\Promise\Promise attachLoadBalancersAsync(array $args = [])
* @method \Aws\Result batchDeleteScheduledAction(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeleteScheduledActionAsync(array $args = [])
* @method \Aws\Result batchPutScheduledUpdateGroupAction(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchPutScheduledUpdateGroupActionAsync(array $args = [])
* @method \Aws\Result cancelInstanceRefresh(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelInstanceRefreshAsync(array $args = [])
* @method \Aws\Result completeLifecycleAction(array $args = [])
* @method \GuzzleHttp\Promise\Promise completeLifecycleActionAsync(array $args = [])
* @method \Aws\Result createAutoScalingGroup(array $args = [])
@ -44,6 +50,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeAutoScalingInstancesAsync(array $args = [])
* @method \Aws\Result describeAutoScalingNotificationTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAutoScalingNotificationTypesAsync(array $args = [])
* @method \Aws\Result describeInstanceRefreshes(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeInstanceRefreshesAsync(array $args = [])
* @method \Aws\Result describeLaunchConfigurations(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeLaunchConfigurationsAsync(array $args = [])
* @method \Aws\Result describeLifecycleHookTypes(array $args = [])
@ -104,6 +112,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise setInstanceHealthAsync(array $args = [])
* @method \Aws\Result setInstanceProtection(array $args = [])
* @method \GuzzleHttp\Promise\Promise setInstanceProtectionAsync(array $args = [])
* @method \Aws\Result startInstanceRefresh(array $args = [])
* @method \GuzzleHttp\Promise\Promise startInstanceRefreshAsync(array $args = [])
* @method \Aws\Result suspendProcesses(array $args = [])
* @method \GuzzleHttp\Promise\Promise suspendProcessesAsync(array $args = [])
* @method \Aws\Result terminateInstanceInAutoScalingGroup(array $args = [])

View file

@ -0,0 +1,21 @@
<?php
namespace Aws\AutoScalingPlans;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Auto Scaling Plans** service.
* @method \Aws\Result createScalingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise createScalingPlanAsync(array $args = [])
* @method \Aws\Result deleteScalingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteScalingPlanAsync(array $args = [])
* @method \Aws\Result describeScalingPlanResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScalingPlanResourcesAsync(array $args = [])
* @method \Aws\Result describeScalingPlans(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeScalingPlansAsync(array $args = [])
* @method \Aws\Result getScalingPlanResourceForecastData(array $args = [])
* @method \GuzzleHttp\Promise\Promise getScalingPlanResourceForecastDataAsync(array $args = [])
* @method \Aws\Result updateScalingPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateScalingPlanAsync(array $args = [])
*/
class AutoScalingPlansClient extends AwsClient {}

View file

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

View file

@ -4,6 +4,10 @@ namespace Aws;
use Aws\Api\ApiProvider;
use Aws\Api\DocModel;
use Aws\Api\Service;
use Aws\ClientSideMonitoring\ApiCallAttemptMonitoringMiddleware;
use Aws\ClientSideMonitoring\ApiCallMonitoringMiddleware;
use Aws\ClientSideMonitoring\ConfigurationProvider;
use Aws\EndpointDiscovery\EndpointDiscoveryMiddleware;
use Aws\Signature\SignatureProvider;
use GuzzleHttp\Psr7\Uri;
@ -14,6 +18,9 @@ class AwsClient implements AwsClientInterface
{
use AwsClientTrait;
/** @var array */
private $aliases;
/** @var array */
private $config;
@ -64,6 +71,16 @@ class AwsClient implements AwsClientInterface
* credentials or return null. See Aws\Credentials\CredentialProvider for
* a list of built-in credentials providers. If no credentials are
* provided, the SDK will attempt to load them from the environment.
* - csm:
* (Aws\ClientSideMonitoring\ConfigurationInterface|array|callable) Specifies
* the credentials used to sign requests. Provide an
* Aws\ClientSideMonitoring\ConfigurationInterface object, a callable
* configuration provider used to create client-side monitoring configuration,
* `false` to disable csm, or an associative array with the following keys:
* enabled: (bool) Set to true to enable client-side monitoring, defaults
* to false; host: (string) the host location to send monitoring events to,
* defaults to 127.0.0.1; port: (int) The port used for the host connection,
* defaults to 31000; client_id: (string) An identifier for this project
* - debug: (bool|array) Set to true to display debug information when
* sending requests. Alternatively, you can provide an associative array
* with the following keys: logfn: (callable) Function that is invoked
@ -82,9 +99,22 @@ class AwsClient implements AwsClientInterface
* `http_stats_receiver` option for this to have an effect; timer: (bool)
* Set to true to enable a command timer that reports the total wall clock
* time spent on an operation in seconds.
* - disable_host_prefix_injection: (bool) Set to true to disable host prefix
* injection logic for services that use it. This disables the entire
* prefix injection, including the portions supplied by user-defined
* parameters. Setting this flag will have no effect on services that do
* not use host prefix injection.
* - endpoint: (string) The full URI of the webservice. This is only
* required when connecting to a custom endpoint (e.g., a local version
* of S3).
* - endpoint_discovery: (Aws\EndpointDiscovery\ConfigurationInterface,
* Aws\CacheInterface, array, callable) Settings for endpoint discovery.
* Provide an instance of Aws\EndpointDiscovery\ConfigurationInterface,
* an instance Aws\CacheInterface, a callable that provides a promise for
* a Configuration object, or an associative array with the following
* keys: enabled: (bool) Set to true to enable endpoint discovery, false
* to explicitly disable it, defaults to false; cache_limit: (int) The
* maximum number of keys in the endpoints cache, defaults to 1000.
* - endpoint_provider: (callable) An optional PHP callable that
* accepts a hash of options including a "service" and "region" key and
* returns NULL or a hash of endpoint data, of which the "endpoint" key
@ -117,8 +147,16 @@ class AwsClient implements AwsClientInterface
* - region: (string, required) Region to connect to. See
* http://docs.aws.amazon.com/general/latest/gr/rande.html for a list of
* available regions.
* - retries: (int, default=int(3)) Configures the maximum number of
* allowed retries for a client (pass 0 to disable retries).
* - retries: (int, Aws\Retry\ConfigurationInterface, Aws\CacheInterface,
* array, callable) Configures the retry mode and maximum number of
* allowed retries for a client (pass 0 to disable retries). Provide an
* integer for 'legacy' mode with the specified number of retries.
* Otherwise provide an instance of Aws\Retry\ConfigurationInterface, an
* instance of Aws\CacheInterface, a callable function, or an array with
* the following keys: mode: (string) Set to 'legacy', 'standard' (uses
* retry quota management), or 'adapative' (an experimental mode that adds
* client-side rate limiting to standard mode); max_attempts (int) The
* maximum number of attempts for a given request.
* - scheme: (string, default=string(5) "https") URI scheme to use when
* connecting connect. The SDK will utilize "https" endpoints (i.e.,
* utilize SSL/TLS connections) by default. You can attempt to connect to
@ -133,6 +171,10 @@ class AwsClient implements AwsClientInterface
* signature version to use with a service (e.g., v4). Note that
* per/operation signature version MAY override this requested signature
* version.
* - use_aws_shared_config_files: (bool, default=bool(true)) Set to false to
* disable checking for shared config file in '~/.aws/config' and
* '~/.aws/credentials'. This will override the AWS_CONFIG_FILE
* environment variable.
* - validate: (bool, default=bool(true)) Set to false to disable
* client-side parameter validation.
* - version: (string, required) The version of the webservice to
@ -152,7 +194,6 @@ class AwsClient implements AwsClientInterface
if (!isset($args['exception_class'])) {
$args['exception_class'] = $exceptionClass;
}
$this->handlerList = new HandlerList();
$resolver = new ClientResolver(static::getArguments());
$config = $resolver->resolve($args, $this->handlerList);
@ -165,6 +206,10 @@ class AwsClient implements AwsClientInterface
$this->defaultRequestOptions = $config['http'];
$this->addSignatureMiddleware();
$this->addInvocationId();
$this->addEndpointParameterMiddleware($args);
$this->addEndpointDiscoveryMiddleware($config, $args);
$this->loadAliases();
$this->addStreamRequestPayload();
if (isset($args['with_resolved'])) {
$args['with_resolved']($config);
@ -236,7 +281,7 @@ class AwsClient implements AwsClientInterface
*
* @return callable
*/
final protected function getSignatureProvider()
final public function getSignatureProvider()
{
return $this->signatureProvider;
}
@ -263,6 +308,35 @@ class AwsClient implements AwsClientInterface
];
}
private function addEndpointParameterMiddleware($args)
{
if (empty($args['disable_host_prefix_injection'])) {
$list = $this->getHandlerList();
$list->appendBuild(
EndpointParameterMiddleware::wrap(
$this->api
),
'endpoint_parameter'
);
}
}
private function addEndpointDiscoveryMiddleware($config, $args)
{
$list = $this->getHandlerList();
if (!isset($args['endpoint'])) {
$list->appendBuild(
EndpointDiscoveryMiddleware::wrap(
$this,
$args,
$config['endpoint_discovery']
),
'EndpointDiscoveryMiddleware'
);
}
}
private function addSignatureMiddleware()
{
$api = $this->getApi();
@ -274,6 +348,9 @@ class AwsClient implements AwsClientInterface
$resolver = static function (
CommandInterface $c
) use ($api, $provider, $name, $region, $version) {
if (!empty($c['@context']['signing_region'])) {
$region = $c['@context']['signing_region'];
}
$authType = $api->getOperation($c->getName())['authtype'];
switch ($authType){
case 'none':
@ -297,6 +374,33 @@ class AwsClient implements AwsClientInterface
$this->handlerList->prependSign(Middleware::invocationId(), 'invocation-id');
}
private function loadAliases($file = null)
{
if (!isset($this->aliases)) {
if (is_null($file)) {
$file = __DIR__ . '/data/aliases.json';
}
$aliases = \Aws\load_compiled_json($file);
$serviceId = $this->api->getServiceId();
$version = $this->getApi()->getApiVersion();
if (!empty($aliases['operations'][$serviceId][$version])) {
$this->aliases = array_flip($aliases['operations'][$serviceId][$version]);
}
}
}
private function addStreamRequestPayload()
{
$streamRequestPayloadMiddleware = StreamRequestPayloadMiddleware::wrap(
$this->api
);
$this->handlerList->prependSign(
$streamRequestPayloadMiddleware,
'StreamRequestPayloadMiddleware'
);
}
/**
* Returns a service model and doc model with any necessary changes
* applied.
@ -311,6 +415,20 @@ class AwsClient implements AwsClientInterface
*/
public static function applyDocFilters(array $api, array $docs)
{
$aliases = \Aws\load_compiled_json(__DIR__ . '/data/aliases.json');
$serviceId = $api['metadata']['serviceId'];
$version = $api['metadata']['apiVersion'];
// Replace names for any operations with SDK aliases
if (!empty($aliases['operations'][$serviceId][$version])) {
foreach ($aliases['operations'][$serviceId][$version] as $op => $alias) {
$api['operations'][$alias] = $api['operations'][$op];
$docs['operations'][$alias] = $docs['operations'][$op];
unset($api['operations'][$op], $docs['operations'][$op]);
}
}
ksort($api['operations']);
return [
new Service($api, ApiProvider::defaultProvider()),
new DocModel($docs)

View file

@ -2,7 +2,6 @@
namespace Aws;
use Aws\Api\Service;
use GuzzleHttp\Promise\Promise;
/**
* A trait providing generic functionality for interacting with Amazon Web
@ -67,11 +66,20 @@ trait AwsClientTrait
public function __call($name, array $args)
{
if (substr($name, -5) === 'Async') {
$name = substr($name, 0, -5);
$isAsync = true;
}
if (!empty($this->aliases[ucfirst($name)])) {
$name = $this->aliases[ucfirst($name)];
}
$params = isset($args[0]) ? $args[0] : [];
if (substr($name, -5) === 'Async') {
if (!empty($isAsync)) {
return $this->executeAsync(
$this->getCommand(substr($name, 0, -5), $params)
$this->getCommand($name, $params)
);
}

View file

@ -0,0 +1,105 @@
<?php
namespace Aws\Backup;
use Aws\AwsClient;
/**
* This client is used to interact with the **AWS Backup** service.
* @method \Aws\Result createBackupPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackupPlanAsync(array $args = [])
* @method \Aws\Result createBackupSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackupSelectionAsync(array $args = [])
* @method \Aws\Result createBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBackupVaultAsync(array $args = [])
* @method \Aws\Result deleteBackupPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupPlanAsync(array $args = [])
* @method \Aws\Result deleteBackupSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupSelectionAsync(array $args = [])
* @method \Aws\Result deleteBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupVaultAsync(array $args = [])
* @method \Aws\Result deleteBackupVaultAccessPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupVaultAccessPolicyAsync(array $args = [])
* @method \Aws\Result deleteBackupVaultNotifications(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupVaultNotificationsAsync(array $args = [])
* @method \Aws\Result deleteRecoveryPoint(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRecoveryPointAsync(array $args = [])
* @method \Aws\Result describeBackupJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBackupJobAsync(array $args = [])
* @method \Aws\Result describeBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBackupVaultAsync(array $args = [])
* @method \Aws\Result describeCopyJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeCopyJobAsync(array $args = [])
* @method \Aws\Result describeProtectedResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeProtectedResourceAsync(array $args = [])
* @method \Aws\Result describeRecoveryPoint(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeRecoveryPointAsync(array $args = [])
* @method \Aws\Result describeRegionSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeRegionSettingsAsync(array $args = [])
* @method \Aws\Result describeRestoreJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeRestoreJobAsync(array $args = [])
* @method \Aws\Result exportBackupPlanTemplate(array $args = [])
* @method \GuzzleHttp\Promise\Promise exportBackupPlanTemplateAsync(array $args = [])
* @method \Aws\Result getBackupPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackupPlanAsync(array $args = [])
* @method \Aws\Result getBackupPlanFromJSON(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackupPlanFromJSONAsync(array $args = [])
* @method \Aws\Result getBackupPlanFromTemplate(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackupPlanFromTemplateAsync(array $args = [])
* @method \Aws\Result getBackupSelection(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackupSelectionAsync(array $args = [])
* @method \Aws\Result getBackupVaultAccessPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackupVaultAccessPolicyAsync(array $args = [])
* @method \Aws\Result getBackupVaultNotifications(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBackupVaultNotificationsAsync(array $args = [])
* @method \Aws\Result getRecoveryPointRestoreMetadata(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRecoveryPointRestoreMetadataAsync(array $args = [])
* @method \Aws\Result getSupportedResourceTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getSupportedResourceTypesAsync(array $args = [])
* @method \Aws\Result listBackupJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupJobsAsync(array $args = [])
* @method \Aws\Result listBackupPlanTemplates(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupPlanTemplatesAsync(array $args = [])
* @method \Aws\Result listBackupPlanVersions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupPlanVersionsAsync(array $args = [])
* @method \Aws\Result listBackupPlans(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupPlansAsync(array $args = [])
* @method \Aws\Result listBackupSelections(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupSelectionsAsync(array $args = [])
* @method \Aws\Result listBackupVaults(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBackupVaultsAsync(array $args = [])
* @method \Aws\Result listCopyJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listCopyJobsAsync(array $args = [])
* @method \Aws\Result listProtectedResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProtectedResourcesAsync(array $args = [])
* @method \Aws\Result listRecoveryPointsByBackupVault(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRecoveryPointsByBackupVaultAsync(array $args = [])
* @method \Aws\Result listRecoveryPointsByResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRecoveryPointsByResourceAsync(array $args = [])
* @method \Aws\Result listRestoreJobs(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRestoreJobsAsync(array $args = [])
* @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result putBackupVaultAccessPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putBackupVaultAccessPolicyAsync(array $args = [])
* @method \Aws\Result putBackupVaultNotifications(array $args = [])
* @method \GuzzleHttp\Promise\Promise putBackupVaultNotificationsAsync(array $args = [])
* @method \Aws\Result startBackupJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startBackupJobAsync(array $args = [])
* @method \Aws\Result startCopyJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startCopyJobAsync(array $args = [])
* @method \Aws\Result startRestoreJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise startRestoreJobAsync(array $args = [])
* @method \Aws\Result stopBackupJob(array $args = [])
* @method \GuzzleHttp\Promise\Promise stopBackupJobAsync(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 updateBackupPlan(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBackupPlanAsync(array $args = [])
* @method \Aws\Result updateRecoveryPointLifecycle(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRecoveryPointLifecycleAsync(array $args = [])
* @method \Aws\Result updateRegionSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRegionSettingsAsync(array $args = [])
*/
class BackupClient extends AwsClient {}

View file

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

View file

@ -0,0 +1,21 @@
<?php
namespace Aws\Braket;
use Aws\AwsClient;
/**
* This client is used to interact with the **Braket** service.
* @method \Aws\Result cancelQuantumTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise cancelQuantumTaskAsync(array $args = [])
* @method \Aws\Result createQuantumTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise createQuantumTaskAsync(array $args = [])
* @method \Aws\Result getDevice(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDeviceAsync(array $args = [])
* @method \Aws\Result getQuantumTask(array $args = [])
* @method \GuzzleHttp\Promise\Promise getQuantumTaskAsync(array $args = [])
* @method \Aws\Result searchDevices(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchDevicesAsync(array $args = [])
* @method \Aws\Result searchQuantumTasks(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchQuantumTasksAsync(array $args = [])
*/
class BraketClient extends AwsClient {}

View file

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

View file

@ -19,6 +19,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteSubscriberAsync(array $args = [])
* @method \Aws\Result describeBudget(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBudgetAsync(array $args = [])
* @method \Aws\Result describeBudgetPerformanceHistory(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBudgetPerformanceHistoryAsync(array $args = [])
* @method \Aws\Result describeBudgets(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeBudgetsAsync(array $args = [])
* @method \Aws\Result describeNotificationsForBudget(array $args = [])

View file

@ -0,0 +1,247 @@
<?php
namespace Aws\Chime;
use Aws\AwsClient;
/**
* This client is used to interact with the **Amazon Chime** service.
* @method \Aws\Result associatePhoneNumberWithUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise associatePhoneNumberWithUserAsync(array $args = [])
* @method \Aws\Result associatePhoneNumbersWithVoiceConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise associatePhoneNumbersWithVoiceConnectorAsync(array $args = [])
* @method \Aws\Result associatePhoneNumbersWithVoiceConnectorGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise associatePhoneNumbersWithVoiceConnectorGroupAsync(array $args = [])
* @method \Aws\Result associateSigninDelegateGroupsWithAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise associateSigninDelegateGroupsWithAccountAsync(array $args = [])
* @method \Aws\Result batchCreateAttendee(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchCreateAttendeeAsync(array $args = [])
* @method \Aws\Result batchCreateRoomMembership(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchCreateRoomMembershipAsync(array $args = [])
* @method \Aws\Result batchDeletePhoneNumber(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchDeletePhoneNumberAsync(array $args = [])
* @method \Aws\Result batchSuspendUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchSuspendUserAsync(array $args = [])
* @method \Aws\Result batchUnsuspendUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchUnsuspendUserAsync(array $args = [])
* @method \Aws\Result batchUpdatePhoneNumber(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchUpdatePhoneNumberAsync(array $args = [])
* @method \Aws\Result batchUpdateUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise batchUpdateUserAsync(array $args = [])
* @method \Aws\Result createAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAccountAsync(array $args = [])
* @method \Aws\Result createAttendee(array $args = [])
* @method \GuzzleHttp\Promise\Promise createAttendeeAsync(array $args = [])
* @method \Aws\Result createBot(array $args = [])
* @method \GuzzleHttp\Promise\Promise createBotAsync(array $args = [])
* @method \Aws\Result createMeeting(array $args = [])
* @method \GuzzleHttp\Promise\Promise createMeetingAsync(array $args = [])
* @method \Aws\Result createMeetingWithAttendees(array $args = [])
* @method \GuzzleHttp\Promise\Promise createMeetingWithAttendeesAsync(array $args = [])
* @method \Aws\Result createPhoneNumberOrder(array $args = [])
* @method \GuzzleHttp\Promise\Promise createPhoneNumberOrderAsync(array $args = [])
* @method \Aws\Result createProxySession(array $args = [])
* @method \GuzzleHttp\Promise\Promise createProxySessionAsync(array $args = [])
* @method \Aws\Result createRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRoomAsync(array $args = [])
* @method \Aws\Result createRoomMembership(array $args = [])
* @method \GuzzleHttp\Promise\Promise createRoomMembershipAsync(array $args = [])
* @method \Aws\Result createUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise createUserAsync(array $args = [])
* @method \Aws\Result createVoiceConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVoiceConnectorAsync(array $args = [])
* @method \Aws\Result createVoiceConnectorGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise createVoiceConnectorGroupAsync(array $args = [])
* @method \Aws\Result deleteAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAccountAsync(array $args = [])
* @method \Aws\Result deleteAttendee(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAttendeeAsync(array $args = [])
* @method \Aws\Result deleteEventsConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteEventsConfigurationAsync(array $args = [])
* @method \Aws\Result deleteMeeting(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteMeetingAsync(array $args = [])
* @method \Aws\Result deletePhoneNumber(array $args = [])
* @method \GuzzleHttp\Promise\Promise deletePhoneNumberAsync(array $args = [])
* @method \Aws\Result deleteProxySession(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteProxySessionAsync(array $args = [])
* @method \Aws\Result deleteRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRoomAsync(array $args = [])
* @method \Aws\Result deleteRoomMembership(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteRoomMembershipAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorEmergencyCallingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorGroupAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorOrigination(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorOriginationAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorProxy(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorProxyAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorStreamingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorStreamingConfigurationAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorTermination(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorTerminationAsync(array $args = [])
* @method \Aws\Result deleteVoiceConnectorTerminationCredentials(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteVoiceConnectorTerminationCredentialsAsync(array $args = [])
* @method \Aws\Result disassociatePhoneNumberFromUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociatePhoneNumberFromUserAsync(array $args = [])
* @method \Aws\Result disassociatePhoneNumbersFromVoiceConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociatePhoneNumbersFromVoiceConnectorAsync(array $args = [])
* @method \Aws\Result disassociatePhoneNumbersFromVoiceConnectorGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociatePhoneNumbersFromVoiceConnectorGroupAsync(array $args = [])
* @method \Aws\Result disassociateSigninDelegateGroupsFromAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise disassociateSigninDelegateGroupsFromAccountAsync(array $args = [])
* @method \Aws\Result getAccount(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountAsync(array $args = [])
* @method \Aws\Result getAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAccountSettingsAsync(array $args = [])
* @method \Aws\Result getAttendee(array $args = [])
* @method \GuzzleHttp\Promise\Promise getAttendeeAsync(array $args = [])
* @method \Aws\Result getBot(array $args = [])
* @method \GuzzleHttp\Promise\Promise getBotAsync(array $args = [])
* @method \Aws\Result getEventsConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEventsConfigurationAsync(array $args = [])
* @method \Aws\Result getGlobalSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getGlobalSettingsAsync(array $args = [])
* @method \Aws\Result getMeeting(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMeetingAsync(array $args = [])
* @method \Aws\Result getPhoneNumber(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPhoneNumberAsync(array $args = [])
* @method \Aws\Result getPhoneNumberOrder(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPhoneNumberOrderAsync(array $args = [])
* @method \Aws\Result getPhoneNumberSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getPhoneNumberSettingsAsync(array $args = [])
* @method \Aws\Result getProxySession(array $args = [])
* @method \GuzzleHttp\Promise\Promise getProxySessionAsync(array $args = [])
* @method \Aws\Result getRetentionSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRetentionSettingsAsync(array $args = [])
* @method \Aws\Result getRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise getRoomAsync(array $args = [])
* @method \Aws\Result getUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUserAsync(array $args = [])
* @method \Aws\Result getUserSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise getUserSettingsAsync(array $args = [])
* @method \Aws\Result getVoiceConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorEmergencyCallingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorGroupAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorLoggingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorLoggingConfigurationAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorOrigination(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorOriginationAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorProxy(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorProxyAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorStreamingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorStreamingConfigurationAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorTermination(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorTerminationAsync(array $args = [])
* @method \Aws\Result getVoiceConnectorTerminationHealth(array $args = [])
* @method \GuzzleHttp\Promise\Promise getVoiceConnectorTerminationHealthAsync(array $args = [])
* @method \Aws\Result inviteUsers(array $args = [])
* @method \GuzzleHttp\Promise\Promise inviteUsersAsync(array $args = [])
* @method \Aws\Result listAccounts(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAccountsAsync(array $args = [])
* @method \Aws\Result listAttendeeTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAttendeeTagsAsync(array $args = [])
* @method \Aws\Result listAttendees(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAttendeesAsync(array $args = [])
* @method \Aws\Result listBots(array $args = [])
* @method \GuzzleHttp\Promise\Promise listBotsAsync(array $args = [])
* @method \Aws\Result listMeetingTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listMeetingTagsAsync(array $args = [])
* @method \Aws\Result listMeetings(array $args = [])
* @method \GuzzleHttp\Promise\Promise listMeetingsAsync(array $args = [])
* @method \Aws\Result listPhoneNumberOrders(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPhoneNumberOrdersAsync(array $args = [])
* @method \Aws\Result listPhoneNumbers(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPhoneNumbersAsync(array $args = [])
* @method \Aws\Result listProxySessions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listProxySessionsAsync(array $args = [])
* @method \Aws\Result listRoomMemberships(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRoomMembershipsAsync(array $args = [])
* @method \Aws\Result listRooms(array $args = [])
* @method \GuzzleHttp\Promise\Promise listRoomsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result listUsers(array $args = [])
* @method \GuzzleHttp\Promise\Promise listUsersAsync(array $args = [])
* @method \Aws\Result listVoiceConnectorGroups(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVoiceConnectorGroupsAsync(array $args = [])
* @method \Aws\Result listVoiceConnectorTerminationCredentials(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVoiceConnectorTerminationCredentialsAsync(array $args = [])
* @method \Aws\Result listVoiceConnectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise listVoiceConnectorsAsync(array $args = [])
* @method \Aws\Result logoutUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise logoutUserAsync(array $args = [])
* @method \Aws\Result putEventsConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putEventsConfigurationAsync(array $args = [])
* @method \Aws\Result putRetentionSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise putRetentionSettingsAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorEmergencyCallingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorEmergencyCallingConfigurationAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorLoggingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorLoggingConfigurationAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorOrigination(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorOriginationAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorProxy(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorProxyAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorStreamingConfiguration(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorStreamingConfigurationAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorTermination(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorTerminationAsync(array $args = [])
* @method \Aws\Result putVoiceConnectorTerminationCredentials(array $args = [])
* @method \GuzzleHttp\Promise\Promise putVoiceConnectorTerminationCredentialsAsync(array $args = [])
* @method \Aws\Result redactConversationMessage(array $args = [])
* @method \GuzzleHttp\Promise\Promise redactConversationMessageAsync(array $args = [])
* @method \Aws\Result redactRoomMessage(array $args = [])
* @method \GuzzleHttp\Promise\Promise redactRoomMessageAsync(array $args = [])
* @method \Aws\Result regenerateSecurityToken(array $args = [])
* @method \GuzzleHttp\Promise\Promise regenerateSecurityTokenAsync(array $args = [])
* @method \Aws\Result resetPersonalPIN(array $args = [])
* @method \GuzzleHttp\Promise\Promise resetPersonalPINAsync(array $args = [])
* @method \Aws\Result restorePhoneNumber(array $args = [])
* @method \GuzzleHttp\Promise\Promise restorePhoneNumberAsync(array $args = [])
* @method \Aws\Result searchAvailablePhoneNumbers(array $args = [])
* @method \GuzzleHttp\Promise\Promise searchAvailablePhoneNumbersAsync(array $args = [])
* @method \Aws\Result tagAttendee(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagAttendeeAsync(array $args = [])
* @method \Aws\Result tagMeeting(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagMeetingAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagAttendee(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagAttendeeAsync(array $args = [])
* @method \Aws\Result untagMeeting(array $args = [])
* @method \GuzzleHttp\Promise\Promise untagMeetingAsync(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 updateAccountSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAccountSettingsAsync(array $args = [])
* @method \Aws\Result updateBot(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateBotAsync(array $args = [])
* @method \Aws\Result updateGlobalSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateGlobalSettingsAsync(array $args = [])
* @method \Aws\Result updatePhoneNumber(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePhoneNumberAsync(array $args = [])
* @method \Aws\Result updatePhoneNumberSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updatePhoneNumberSettingsAsync(array $args = [])
* @method \Aws\Result updateProxySession(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateProxySessionAsync(array $args = [])
* @method \Aws\Result updateRoom(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRoomAsync(array $args = [])
* @method \Aws\Result updateRoomMembership(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateRoomMembershipAsync(array $args = [])
* @method \Aws\Result updateUser(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateUserAsync(array $args = [])
* @method \Aws\Result updateUserSettings(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateUserSettingsAsync(array $args = [])
* @method \Aws\Result updateVoiceConnector(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVoiceConnectorAsync(array $args = [])
* @method \Aws\Result updateVoiceConnectorGroup(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateVoiceConnectorGroupAsync(array $args = [])
*/
class ChimeClient extends AwsClient {}

View file

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

View file

@ -4,15 +4,21 @@ namespace Aws;
use Aws\Api\Validator;
use Aws\Api\ApiProvider;
use Aws\Api\Service;
use Aws\ClientSideMonitoring\ApiCallAttemptMonitoringMiddleware;
use Aws\ClientSideMonitoring\ApiCallMonitoringMiddleware;
use Aws\ClientSideMonitoring\Configuration;
use Aws\Credentials\Credentials;
use Aws\Credentials\CredentialsInterface;
use Aws\Endpoint\Partition;
use Aws\Endpoint\PartitionEndpointProvider;
use Aws\Endpoint\PartitionProviderInterface;
use Aws\EndpointDiscovery\ConfigurationInterface;
use Aws\EndpointDiscovery\ConfigurationProvider;
use Aws\EndpointDiscovery\EndpointDiscoveryMiddleware;
use Aws\Exception\InvalidRegionException;
use Aws\Retry\ConfigurationInterface as RetryConfigInterface;
use Aws\Retry\ConfigurationProvider as RetryConfigProvider;
use Aws\Signature\SignatureProvider;
use Aws\Endpoint\EndpointProvider;
use Aws\Credentials\CredentialProvider;
use GuzzleHttp\Promise;
use InvalidArgumentException as IAE;
use Psr\Http\Message\RequestInterface;
@ -56,6 +62,12 @@ class ClientResolver
'default' => 'https',
'doc' => 'URI scheme to use when connecting connect. The SDK will utilize "https" endpoints (i.e., utilize SSL/TLS connections) by default. You can attempt to connect to a service over an unencrypted "http" endpoint by setting ``scheme`` to "http".',
],
'disable_host_prefix_injection' => [
'type' => 'value',
'valid' => ['bool'],
'doc' => 'Set to true to disable host prefix injection logic for services that use it. This disables the entire prefix injection, including the portions supplied by user-defined parameters. Setting this flag will have no effect on services that do not use host prefix injection.',
'default' => false,
],
'endpoint' => [
'type' => 'value',
'valid' => ['string'],
@ -130,7 +142,14 @@ class ClientResolver
'valid' => [CredentialsInterface::class, CacheInterface::class, 'array', 'bool', 'callable'],
'doc' => 'Specifies the credentials used to sign requests. Provide an Aws\Credentials\CredentialsInterface object, an associative array of "key", "secret", and an optional "token" key, `false` to use null credentials, or a callable credentials provider used to create credentials or return null. See Aws\\Credentials\\CredentialProvider for a list of built-in credentials providers. If no credentials are provided, the SDK will attempt to load them from the environment.',
'fn' => [__CLASS__, '_apply_credentials'],
'default' => [CredentialProvider::class, 'defaultProvider'],
'default' => [__CLASS__, '_default_credential_provider'],
],
'endpoint_discovery' => [
'type' => 'value',
'valid' => [ConfigurationInterface::class, CacheInterface::class, 'array', 'callable'],
'doc' => 'Specifies settings for endpoint discovery. Provide an instance of Aws\EndpointDiscovery\ConfigurationInterface, an instance Aws\CacheInterface, a callable that provides a promise for a Configuration object, or an associative array with the following keys: enabled: (bool) Set to true to enable endpoint discovery, false to explicitly disable it. Defaults to false; cache_limit: (int) The maximum number of keys in the endpoints cache. Defaults to 1000.',
'fn' => [__CLASS__, '_apply_endpoint_discovery'],
'default' => [__CLASS__, '_default_endpoint_discovery_provider']
],
'stats' => [
'type' => 'value',
@ -141,10 +160,10 @@ class ClientResolver
],
'retries' => [
'type' => 'value',
'valid' => ['int'],
'doc' => 'Configures the maximum number of allowed retries for a client (pass 0 to disable retries). ',
'valid' => ['int', RetryConfigInterface::class, CacheInterface::class, 'callable', 'array'],
'doc' => "Configures the retry mode and maximum number of allowed retries for a client (pass 0 to disable retries). Provide an integer for 'legacy' mode with the specified number of retries. Otherwise provide an instance of Aws\Retry\ConfigurationInterface, an instance of Aws\CacheInterface, a callable function, or an array with the following keys: mode: (string) Set to 'legacy', 'standard' (uses retry quota management), or 'adapative' (an experimental mode that adds client-side rate limiting to standard mode); max_attempts: (int) The maximum number of attempts for a given request. ",
'fn' => [__CLASS__, '_apply_retries'],
'default' => 3,
'default' => [RetryConfigProvider::class, 'defaultProvider']
],
'validate' => [
'type' => 'value',
@ -159,6 +178,13 @@ class ClientResolver
'doc' => 'Set to true to display debug information when sending requests. Alternatively, you can provide an associative array with the following keys: logfn: (callable) Function that is invoked with log messages; stream_size: (int) When the size of a stream is greater than this number, the stream data will not be logged (set to "0" to not log any stream data); scrub_auth: (bool) Set to false to disable the scrubbing of auth data from the logged messages; http: (bool) Set to false to disable the "debug" feature of lower level HTTP adapters (e.g., verbose curl output).',
'fn' => [__CLASS__, '_apply_debug'],
],
'csm' => [
'type' => 'value',
'valid' => [\Aws\ClientSideMonitoring\ConfigurationInterface::class, 'callable', 'array', 'bool'],
'doc' => 'CSM options for the client. Provides a callable wrapping a promise, a boolean "false", an instance of ConfigurationInterface, or an associative array of "enabled", "host", "port", and "client_id".',
'fn' => [__CLASS__, '_apply_csm'],
'default' => [\Aws\ClientSideMonitoring\ConfigurationProvider::class, 'defaultProvider']
],
'http' => [
'type' => 'value',
'valid' => ['array'],
@ -192,6 +218,12 @@ class ClientResolver
'default' => true,
'fn' => [__CLASS__, '_apply_idempotency_auto_fill']
],
'use_aws_shared_config_files' => [
'type' => 'value',
'valid' => ['bool'],
'doc' => 'Set to false to disable checking for shared aws config files usually located in \'~/.aws/config\' and \'~/.aws/credentials\'.',
'default' => true,
],
];
/**
@ -376,12 +408,28 @@ class ClientResolver
public static function _apply_retries($value, array &$args, HandlerList $list)
{
// A value of 0 for the config option disables retries
if ($value) {
$decider = RetryMiddleware::createDefaultDecider($value);
$list->appendSign(
Middleware::retry($decider, null, $args['stats']['retries']),
'retry'
);
$config = RetryConfigProvider::unwrap($value);
if ($config->getMode() === 'legacy') {
// # of retries is 1 less than # of attempts
$decider = RetryMiddleware::createDefaultDecider(
$config->getMaxAttempts() - 1
);
$list->appendSign(
Middleware::retry($decider, null, $args['stats']['retries']),
'retry'
);
} else {
$list->appendSign(
RetryMiddlewareV2::wrap(
$config,
['collect_stats' => $args['stats']['retries']]
),
'retry'
);
}
}
}
@ -389,7 +437,9 @@ class ClientResolver
{
if (is_callable($value)) {
return;
} elseif ($value instanceof CredentialsInterface) {
}
if ($value instanceof CredentialsInterface) {
$args['credentials'] = CredentialProvider::fromCredentials($value);
} elseif (is_array($value)
&& isset($value['key'])
@ -418,6 +468,44 @@ class ClientResolver
}
}
public static function _default_credential_provider(array $args)
{
return CredentialProvider::defaultProvider($args);
}
public static function _apply_csm($value, array &$args, HandlerList $list)
{
if ($value === false) {
$value = new Configuration(
false,
\Aws\ClientSideMonitoring\ConfigurationProvider::DEFAULT_HOST,
\Aws\ClientSideMonitoring\ConfigurationProvider::DEFAULT_PORT,
\Aws\ClientSideMonitoring\ConfigurationProvider::DEFAULT_CLIENT_ID
);
$args['csm'] = $value;
}
$list->appendBuild(
ApiCallMonitoringMiddleware::wrap(
$args['credentials'],
$value,
$args['region'],
$args['api']->getServiceId()
),
'ApiCallMonitoringMiddleware'
);
$list->appendAttempt(
ApiCallAttemptMonitoringMiddleware::wrap(
$args['credentials'],
$value,
$args['region'],
$args['api']->getServiceId()
),
'ApiCallAttemptMonitoringMiddleware'
);
}
public static function _apply_api_provider(callable $value, array &$args)
{
$api = new Service(
@ -439,7 +527,7 @@ class ClientResolver
$args['api'] = $api;
$args['parser'] = Service::createParser($api);
$args['error_parser'] = Service::createErrorParser($api->getProtocol());
$args['error_parser'] = Service::createErrorParser($api->getProtocol(), $api);
}
public static function _apply_endpoint_provider(callable $value, array &$args)
@ -449,11 +537,19 @@ class ClientResolver
? $args['api']['metadata']['endpointPrefix']
: $args['service'];
// Check region is a valid host label when it is being used to
// generate an endpoint
if (!self::isValidRegion($args['region'])) {
throw new InvalidRegionException('Region must be a valid RFC'
. ' host label.');
}
// Invoke the endpoint provider and throw if it does not resolve.
$result = EndpointProvider::resolve($value, [
'service' => $endpointPrefix,
'region' => $args['region'],
'scheme' => $args['scheme']
'scheme' => $args['scheme'],
'options' => self::getEndpointProviderOptions($args),
]);
$args['endpoint'] = $result['endpoint'];
@ -482,6 +578,15 @@ class ClientResolver
}
}
public static function _apply_endpoint_discovery($value, array &$args) {
$args['endpoint_discovery'] = $value;
}
public static function _default_endpoint_discovery_provider(array $args)
{
return ConfigurationProvider::defaultProvider($args);
}
public static function _apply_serializer($value, array &$args, HandlerList $list)
{
$list->prependBuild(Middleware::requestBuilder($value), 'builder');
@ -627,7 +732,8 @@ class ClientResolver
public static function _default_endpoint_provider(array $args)
{
return PartitionEndpointProvider::defaultProvider()
$options = self::getEndpointProviderOptions($args);
return PartitionEndpointProvider::defaultProvider($options)
->getPartition($args['region'], $args['service']);
}
@ -741,4 +847,33 @@ A "region" configuration value is required for the "{$service}" service
found at http://docs.aws.amazon.com/general/latest/gr/rande.html.
EOT;
}
/**
* Extracts client options for the endpoint provider to its own array
*
* @param array $args
* @return array
*/
private static function getEndpointProviderOptions(array $args)
{
$options = [];
$optionKeys = ['sts_regional_endpoints', 's3_us_east_1_regional_endpoint'];
foreach ($optionKeys as $key) {
if (isset($args[$key])) {
$options[$key] = $args[$key];
}
}
return $options;
}
/**
* Validates a region to be used for endpoint construction
*
* @param $region
* @return bool
*/
private static function isValidRegion($region)
{
return is_valid_hostlabel($region);
}
}

View file

@ -0,0 +1,289 @@
<?php
namespace Aws\ClientSideMonitoring;
use Aws\CommandInterface;
use Aws\Exception\AwsException;
use Aws\MonitoringEventsInterface;
use Aws\ResponseContainerInterface;
use Aws\ResultInterface;
use GuzzleHttp\Promise;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* @internal
*/
abstract class AbstractMonitoringMiddleware
implements MonitoringMiddlewareInterface
{
private static $socket;
private $nextHandler;
private $options;
protected $credentialProvider;
protected $region;
protected $service;
protected static function getAwsExceptionHeader(AwsException $e, $headerName)
{
$response = $e->getResponse();
if ($response !== null) {
$header = $response->getHeader($headerName);
if (!empty($header[0])) {
return $header[0];
}
}
return null;
}
protected static function getResultHeader(ResultInterface $result, $headerName)
{
if (isset($result['@metadata']['headers'][$headerName])) {
return $result['@metadata']['headers'][$headerName];
}
return null;
}
protected static function getExceptionHeader(\Exception $e, $headerName)
{
if ($e instanceof ResponseContainerInterface) {
$response = $e->getResponse();
if ($response instanceof ResponseInterface) {
$header = $response->getHeader($headerName);
if (!empty($header[0])) {
return $header[0];
}
}
}
return null;
}
/**
* Constructor stores the passed in handler and options.
*
* @param callable $handler
* @param callable $credentialProvider
* @param $options
* @param $region
* @param $service
*/
public function __construct(
callable $handler,
callable $credentialProvider,
$options,
$region,
$service
) {
$this->nextHandler = $handler;
$this->credentialProvider = $credentialProvider;
$this->options = $options;
$this->region = $region;
$this->service = $service;
}
/**
* Standard invoke pattern for middleware execution to be implemented by
* child classes.
*
* @param CommandInterface $cmd
* @param RequestInterface $request
* @return Promise\PromiseInterface
*/
public function __invoke(CommandInterface $cmd, RequestInterface $request)
{
$handler = $this->nextHandler;
$eventData = null;
$enabled = $this->isEnabled();
if ($enabled) {
$cmd['@http']['collect_stats'] = true;
$eventData = $this->populateRequestEventData(
$cmd,
$request,
$this->getNewEvent($cmd, $request)
);
}
$g = function ($value) use ($eventData, $enabled) {
if ($enabled) {
$eventData = $this->populateResultEventData(
$value,
$eventData
);
$this->sendEventData($eventData);
if ($value instanceof MonitoringEventsInterface) {
$value->appendMonitoringEvent($eventData);
}
}
if ($value instanceof \Exception || $value instanceof \Throwable) {
return Promise\rejection_for($value);
}
return $value;
};
return Promise\promise_for($handler($cmd, $request))->then($g, $g);
}
private function getClientId()
{
return $this->unwrappedOptions()->getClientId();
}
private function getNewEvent(
CommandInterface $cmd,
RequestInterface $request
) {
$event = [
'Api' => $cmd->getName(),
'ClientId' => $this->getClientId(),
'Region' => $this->getRegion(),
'Service' => $this->getService(),
'Timestamp' => (int) floor(microtime(true) * 1000),
'UserAgent' => substr(
$request->getHeaderLine('User-Agent') . ' ' . \Aws\default_user_agent(),
0,
256
),
'Version' => 1
];
return $event;
}
private function getHost()
{
return $this->unwrappedOptions()->getHost();
}
private function getPort()
{
return $this->unwrappedOptions()->getPort();
}
private function getRegion()
{
return $this->region;
}
private function getService()
{
return $this->service;
}
/**
* Returns enabled flag from options, unwrapping options if necessary.
*
* @return bool
*/
private function isEnabled()
{
return $this->unwrappedOptions()->isEnabled();
}
/**
* Returns $eventData array with information from the request and command.
*
* @param CommandInterface $cmd
* @param RequestInterface $request
* @param array $event
* @return array
*/
protected function populateRequestEventData(
CommandInterface $cmd,
RequestInterface $request,
array $event
) {
$dataFormat = static::getRequestData($request);
foreach ($dataFormat as $eventKey => $value) {
if ($value !== null) {
$event[$eventKey] = $value;
}
}
return $event;
}
/**
* Returns $eventData array with information from the response, including
* the calculation for attempt latency.
*
* @param ResultInterface|\Exception $result
* @param array $event
* @return array
*/
protected function populateResultEventData(
$result,
array $event
) {
$dataFormat = static::getResponseData($result);
foreach ($dataFormat as $eventKey => $value) {
if ($value !== null) {
$event[$eventKey] = $value;
}
}
return $event;
}
/**
* Creates a UDP socket resource and stores it with the class, or retrieves
* it if already instantiated and connected. Handles error-checking and
* re-connecting if necessary. If $forceNewConnection is set to true, a new
* socket will be created.
*
* @param bool $forceNewConnection
* @return Resource
*/
private function prepareSocket($forceNewConnection = false)
{
if (!is_resource(self::$socket)
|| $forceNewConnection
|| socket_last_error(self::$socket)
) {
self::$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_clear_error(self::$socket);
socket_connect(self::$socket, $this->getHost(), $this->getPort());
}
return self::$socket;
}
/**
* Sends formatted monitoring event data via the UDP socket connection to
* the CSM agent endpoint.
*
* @param array $eventData
* @return int
*/
private function sendEventData(array $eventData)
{
$socket = $this->prepareSocket();
$datagram = json_encode($eventData);
$result = socket_write($socket, $datagram, strlen($datagram));
if ($result === false) {
$this->prepareSocket(true);
}
return $result;
}
/**
* Unwraps options, if needed, and returns them.
*
* @return ConfigurationInterface
*/
private function unwrappedOptions()
{
if (!($this->options instanceof ConfigurationInterface)) {
try {
$this->options = ConfigurationProvider::unwrap($this->options);
} catch (\Exception $e) {
// Errors unwrapping CSM config defaults to disabling it
$this->options = new Configuration(
false,
ConfigurationProvider::DEFAULT_HOST,
ConfigurationProvider::DEFAULT_PORT
);
}
}
return $this->options;
}
}

View file

@ -0,0 +1,262 @@
<?php
namespace Aws\ClientSideMonitoring;
use Aws\CommandInterface;
use Aws\Credentials\CredentialsInterface;
use Aws\Exception\AwsException;
use Aws\ResponseContainerInterface;
use Aws\ResultInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* @internal
*/
class ApiCallAttemptMonitoringMiddleware extends AbstractMonitoringMiddleware
{
/**
* Standard middleware wrapper function with CSM options passed in.
*
* @param callable $credentialProvider
* @param mixed $options
* @param string $region
* @param string $service
* @return callable
*/
public static function wrap(
callable $credentialProvider,
$options,
$region,
$service
) {
return function (callable $handler) use (
$credentialProvider,
$options,
$region,
$service
) {
return new static(
$handler,
$credentialProvider,
$options,
$region,
$service
);
};
}
/**
* {@inheritdoc}
*/
public static function getRequestData(RequestInterface $request)
{
return [
'Fqdn' => $request->getUri()->getHost(),
];
}
/**
* {@inheritdoc}
*/
public static function getResponseData($klass)
{
if ($klass instanceof ResultInterface) {
return [
'AttemptLatency' => self::getResultAttemptLatency($klass),
'DestinationIp' => self::getResultDestinationIp($klass),
'DnsLatency' => self::getResultDnsLatency($klass),
'HttpStatusCode' => self::getResultHttpStatusCode($klass),
'XAmzId2' => self::getResultHeader($klass, 'x-amz-id-2'),
'XAmzRequestId' => self::getResultHeader($klass, 'x-amz-request-id'),
'XAmznRequestId' => self::getResultHeader($klass, 'x-amzn-RequestId'),
];
}
if ($klass instanceof AwsException) {
return [
'AttemptLatency' => self::getAwsExceptionAttemptLatency($klass),
'AwsException' => substr(
self::getAwsExceptionErrorCode($klass),
0,
128
),
'AwsExceptionMessage' => substr(
self::getAwsExceptionMessage($klass),
0,
512
),
'DestinationIp' => self::getAwsExceptionDestinationIp($klass),
'DnsLatency' => self::getAwsExceptionDnsLatency($klass),
'HttpStatusCode' => self::getAwsExceptionHttpStatusCode($klass),
'XAmzId2' => self::getAwsExceptionHeader($klass, 'x-amz-id-2'),
'XAmzRequestId' => self::getAwsExceptionHeader(
$klass,
'x-amz-request-id'
),
'XAmznRequestId' => self::getAwsExceptionHeader(
$klass,
'x-amzn-RequestId'
),
];
}
if ($klass instanceof \Exception) {
return [
'HttpStatusCode' => self::getExceptionHttpStatusCode($klass),
'SdkException' => substr(
self::getExceptionCode($klass),
0,
128
),
'SdkExceptionMessage' => substr(
self::getExceptionMessage($klass),
0,
512
),
'XAmzId2' => self::getExceptionHeader($klass, 'x-amz-id-2'),
'XAmzRequestId' => self::getExceptionHeader($klass, 'x-amz-request-id'),
'XAmznRequestId' => self::getExceptionHeader($klass, 'x-amzn-RequestId'),
];
}
throw new \InvalidArgumentException('Parameter must be an instance of ResultInterface, AwsException or Exception.');
}
private static function getResultAttemptLatency(ResultInterface $result)
{
if (isset($result['@metadata']['transferStats']['http'])) {
$attempt = end($result['@metadata']['transferStats']['http']);
if (isset($attempt['total_time'])) {
return (int) floor($attempt['total_time'] * 1000);
}
}
return null;
}
private static function getResultDestinationIp(ResultInterface $result)
{
if (isset($result['@metadata']['transferStats']['http'])) {
$attempt = end($result['@metadata']['transferStats']['http']);
if (isset($attempt['primary_ip'])) {
return $attempt['primary_ip'];
}
}
return null;
}
private static function getResultDnsLatency(ResultInterface $result)
{
if (isset($result['@metadata']['transferStats']['http'])) {
$attempt = end($result['@metadata']['transferStats']['http']);
if (isset($attempt['namelookup_time'])) {
return (int) floor($attempt['namelookup_time'] * 1000);
}
}
return null;
}
private static function getResultHttpStatusCode(ResultInterface $result)
{
return $result['@metadata']['statusCode'];
}
private static function getAwsExceptionAttemptLatency(AwsException $e) {
$attempt = $e->getTransferInfo();
if (isset($attempt['total_time'])) {
return (int) floor($attempt['total_time'] * 1000);
}
return null;
}
private static function getAwsExceptionErrorCode(AwsException $e) {
return $e->getAwsErrorCode();
}
private static function getAwsExceptionMessage(AwsException $e) {
return $e->getAwsErrorMessage();
}
private static function getAwsExceptionDestinationIp(AwsException $e) {
$attempt = $e->getTransferInfo();
if (isset($attempt['primary_ip'])) {
return $attempt['primary_ip'];
}
return null;
}
private static function getAwsExceptionDnsLatency(AwsException $e) {
$attempt = $e->getTransferInfo();
if (isset($attempt['namelookup_time'])) {
return (int) floor($attempt['namelookup_time'] * 1000);
}
return null;
}
private static function getAwsExceptionHttpStatusCode(AwsException $e) {
$response = $e->getResponse();
if ($response !== null) {
return $response->getStatusCode();
}
return null;
}
private static function getExceptionHttpStatusCode(\Exception $e) {
if ($e instanceof ResponseContainerInterface) {
$response = $e->getResponse();
if ($response instanceof ResponseInterface) {
return $response->getStatusCode();
}
}
return null;
}
private static function getExceptionCode(\Exception $e) {
if (!($e instanceof AwsException)) {
return get_class($e);
}
return null;
}
private static function getExceptionMessage(\Exception $e) {
if (!($e instanceof AwsException)) {
return $e->getMessage();
}
return null;
}
/**
* {@inheritdoc}
*/
protected function populateRequestEventData(
CommandInterface $cmd,
RequestInterface $request,
array $event
) {
$event = parent::populateRequestEventData($cmd, $request, $event);
$event['Type'] = 'ApiCallAttempt';
return $event;
}
/**
* {@inheritdoc}
*/
protected function populateResultEventData(
$result,
array $event
) {
$event = parent::populateResultEventData($result, $event);
$provider = $this->credentialProvider;
/** @var CredentialsInterface $credentials */
$credentials = $provider()->wait();
$event['AccessKey'] = $credentials->getAccessKeyId();
$sessionToken = $credentials->getSecurityToken();
if ($sessionToken !== null) {
$event['SessionToken'] = $sessionToken;
}
if (empty($event['AttemptLatency'])) {
$event['AttemptLatency'] = (int) (floor(microtime(true) * 1000) - $event['Timestamp']);
}
return $event;
}
}

View file

@ -0,0 +1,176 @@
<?php
namespace Aws\ClientSideMonitoring;
use Aws\CommandInterface;
use Aws\Exception\AwsException;
use Aws\MonitoringEventsInterface;
use Aws\ResultInterface;
use Psr\Http\Message\RequestInterface;
/**
* @internal
*/
class ApiCallMonitoringMiddleware extends AbstractMonitoringMiddleware
{
/**
* Api Call Attempt event keys for each Api Call event key
*
* @var array
*/
private static $eventKeys = [
'FinalAwsException' => 'AwsException',
'FinalAwsExceptionMessage' => 'AwsExceptionMessage',
'FinalSdkException' => 'SdkException',
'FinalSdkExceptionMessage' => 'SdkExceptionMessage',
'FinalHttpStatusCode' => 'HttpStatusCode',
];
/**
* Standard middleware wrapper function with CSM options passed in.
*
* @param callable $credentialProvider
* @param mixed $options
* @param string $region
* @param string $service
* @return callable
*/
public static function wrap(
callable $credentialProvider,
$options,
$region,
$service
) {
return function (callable $handler) use (
$credentialProvider,
$options,
$region,
$service
) {
return new static(
$handler,
$credentialProvider,
$options,
$region,
$service
);
};
}
/**
* {@inheritdoc}
*/
public static function getRequestData(RequestInterface $request)
{
return [];
}
/**
* {@inheritdoc}
*/
public static function getResponseData($klass)
{
if ($klass instanceof ResultInterface) {
$data = [
'AttemptCount' => self::getResultAttemptCount($klass),
'MaxRetriesExceeded' => 0,
];
} elseif ($klass instanceof \Exception) {
$data = [
'AttemptCount' => self::getExceptionAttemptCount($klass),
'MaxRetriesExceeded' => self::getMaxRetriesExceeded($klass),
];
} else {
throw new \InvalidArgumentException('Parameter must be an instance of ResultInterface or Exception.');
}
return $data + self::getFinalAttemptData($klass);
}
private static function getResultAttemptCount(ResultInterface $result) {
if (isset($result['@metadata']['transferStats']['http'])) {
return count($result['@metadata']['transferStats']['http']);
}
return 1;
}
private static function getExceptionAttemptCount(\Exception $e) {
$attemptCount = 0;
if ($e instanceof MonitoringEventsInterface) {
foreach ($e->getMonitoringEvents() as $event) {
if (isset($event['Type']) &&
$event['Type'] === 'ApiCallAttempt') {
$attemptCount++;
}
}
}
return $attemptCount;
}
private static function getFinalAttemptData($klass)
{
$data = [];
if ($klass instanceof MonitoringEventsInterface) {
$finalAttempt = self::getFinalAttempt($klass->getMonitoringEvents());
if (!empty($finalAttempt)) {
foreach (self::$eventKeys as $callKey => $attemptKey) {
if (isset($finalAttempt[$attemptKey])) {
$data[$callKey] = $finalAttempt[$attemptKey];
}
}
}
}
return $data;
}
private static function getFinalAttempt(array $events)
{
for (end($events); key($events) !== null; prev($events)) {
$current = current($events);
if (isset($current['Type'])
&& $current['Type'] === 'ApiCallAttempt'
) {
return $current;
}
}
return null;
}
private static function getMaxRetriesExceeded($klass)
{
if ($klass instanceof AwsException && $klass->isMaxRetriesExceeded()) {
return 1;
}
return 0;
}
/**
* {@inheritdoc}
*/
protected function populateRequestEventData(
CommandInterface $cmd,
RequestInterface $request,
array $event
) {
$event = parent::populateRequestEventData($cmd, $request, $event);
$event['Type'] = 'ApiCall';
return $event;
}
/**
* {@inheritdoc}
*/
protected function populateResultEventData(
$result,
array $event
) {
$event = parent::populateResultEventData($result, $event);
$event['Latency'] = (int) (floor(microtime(true) * 1000) - $event['Timestamp']);
return $event;
}
}

View file

@ -0,0 +1,77 @@
<?php
namespace Aws\ClientSideMonitoring;
class Configuration implements ConfigurationInterface
{
private $clientId;
private $enabled;
private $host;
private $port;
/**
* Constructs a new Configuration object with the specified CSM options set.
*
* @param mixed $enabled
* @param string $host
* @param string|int $port
* @param string $clientId
*/
public function __construct($enabled, $host, $port, $clientId = '')
{
$this->host = $host;
$this->port = filter_var($port, FILTER_VALIDATE_INT);
if ($this->port === false) {
throw new \InvalidArgumentException(
"CSM 'port' value must be an integer!");
}
// Unparsable $enabled flag errors on the side of disabling CSM
$this->enabled = filter_var($enabled, FILTER_VALIDATE_BOOLEAN);
$this->clientId = trim($clientId);
}
/**
* {@inheritdoc}
*/
public function isEnabled()
{
return $this->enabled;
}
/**
* {@inheritdoc}
*/
public function getClientId()
{
return $this->clientId;
}
/**
* /{@inheritdoc}
*/
public function getHost()
{
return $this->host;
}
/**
* {@inheritdoc}
*/
public function getPort()
{
return $this->port;
}
/**
* {@inheritdoc}
*/
public function toArray()
{
return [
'client_id' => $this->getClientId(),
'enabled' => $this->isEnabled(),
'host' => $this->getHost(),
'port' => $this->getPort()
];
}
}

View file

@ -0,0 +1,44 @@
<?php
namespace Aws\ClientSideMonitoring;
/**
* Provides access to client-side monitoring configuration options:
* 'client_id', 'enabled', 'host', 'port'
*/
interface ConfigurationInterface
{
/**
* Checks whether or not client-side monitoring is enabled.
*
* @return bool
*/
public function isEnabled();
/**
* Returns the Client ID, if available.
*
* @return string|null
*/
public function getClientId();
/**
* Returns the configured host.
*
* @return string|null
*/
public function getHost();
/**
* Returns the configured port.
*
* @return int|null
*/
public function getPort();
/**
* Returns the configuration as an associative array.
*
* @return array
*/
public function toArray();
}

View file

@ -0,0 +1,236 @@
<?php
namespace Aws\ClientSideMonitoring;
use Aws\AbstractConfigurationProvider;
use Aws\CacheInterface;
use Aws\ClientSideMonitoring\Exception\ConfigurationException;
use Aws\ConfigurationProviderInterface;
use GuzzleHttp\Promise;
use GuzzleHttp\Promise\PromiseInterface;
/**
* A configuration provider is a function that accepts no arguments and returns
* a promise that is fulfilled with a {@see \Aws\ClientSideMonitoring\ConfigurationInterface}
* or rejected with an {@see \Aws\ClientSideMonitoring\Exception\ConfigurationException}.
*
* <code>
* use Aws\ClientSideMonitoring\ConfigurationProvider;
* $provider = ConfigurationProvider::defaultProvider();
* // Returns a ConfigurationInterface or throws.
* $config = $provider()->wait();
* </code>
*
* Configuration providers can be composed to create configuration using
* conditional logic that can create different configurations in different
* environments. You can compose multiple providers into a single provider using
* {@see Aws\ClientSideMonitoring\ConfigurationProvider::chain}. This function
* accepts providers as variadic arguments and returns a new function that will
* invoke each provider until a successful configuration is returned.
*
* <code>
* // First try an INI file at this location.
* $a = ConfigurationProvider::ini(null, '/path/to/file.ini');
* // Then try an INI file at this location.
* $b = ConfigurationProvider::ini(null, '/path/to/other-file.ini');
* // Then try loading from environment variables.
* $c = ConfigurationProvider::env();
* // Combine the three providers together.
* $composed = ConfigurationProvider::chain($a, $b, $c);
* // Returns a promise that is fulfilled with a configuration or throws.
* $promise = $composed();
* // Wait on the configuration to resolve.
* $config = $promise->wait();
* </code>
*/
class ConfigurationProvider extends AbstractConfigurationProvider
implements ConfigurationProviderInterface
{
const DEFAULT_CLIENT_ID = '';
const DEFAULT_ENABLED = false;
const DEFAULT_HOST = '127.0.0.1';
const DEFAULT_PORT = 31000;
const ENV_CLIENT_ID = 'AWS_CSM_CLIENT_ID';
const ENV_ENABLED = 'AWS_CSM_ENABLED';
const ENV_HOST = 'AWS_CSM_HOST';
const ENV_PORT = 'AWS_CSM_PORT';
const ENV_PROFILE = 'AWS_PROFILE';
public static $cacheKey = 'aws_cached_csm_config';
protected static $interfaceClass = ConfigurationInterface::class;
protected static $exceptionClass = ConfigurationException::class;
/**
* Create a default config provider that first checks for environment
* variables, then checks for a specified profile in the environment-defined
* config file location (env variable is 'AWS_CONFIG_FILE', file location
* defaults to ~/.aws/config), then checks for the "default" profile in the
* environment-defined config file location, and failing those uses a default
* fallback set of configuration options.
*
* This provider is automatically wrapped in a memoize function that caches
* previously provided config options.
*
* @param array $config
*
* @return callable
*/
public static function defaultProvider(array $config = [])
{
$configProviders = [self::env()];
if (
!isset($config['use_aws_shared_config_files'])
|| $config['use_aws_shared_config_files'] != false
) {
$configProviders[] = self::ini();
}
$configProviders[] = self::fallback();
$memo = self::memoize(
call_user_func_array('self::chain', $configProviders)
);
if (isset($config['csm']) && $config['csm'] instanceof CacheInterface) {
return self::cache($memo, $config['csm'], self::$cacheKey);
}
return $memo;
}
/**
* Provider that creates CSM config from environment variables.
*
* @return callable
*/
public static function env()
{
return function () {
// Use credentials from environment variables, if available
$enabled = getenv(self::ENV_ENABLED);
if ($enabled !== false) {
return Promise\promise_for(
new Configuration(
$enabled,
getenv(self::ENV_HOST) ?: self::DEFAULT_HOST,
getenv(self::ENV_PORT) ?: self::DEFAULT_PORT,
getenv(self:: ENV_CLIENT_ID) ?: self::DEFAULT_CLIENT_ID
)
);
}
return self::reject('Could not find environment variable CSM config'
. ' in ' . self::ENV_ENABLED. '/' . self::ENV_HOST . '/'
. self::ENV_PORT . '/' . self::ENV_CLIENT_ID);
};
}
/**
* Fallback config options when other sources are not set.
*
* @return callable
*/
public static function fallback()
{
return function() {
return Promise\promise_for(
new Configuration(
self::DEFAULT_ENABLED,
self::DEFAULT_HOST,
self::DEFAULT_PORT,
self::DEFAULT_CLIENT_ID
)
);
};
}
/**
* Config provider that creates config using a config file whose location
* is specified by an environment variable 'AWS_CONFIG_FILE', defaulting to
* ~/.aws/config if not specified
*
* @param string|null $profile Profile to use. If not specified will use
* the "default" profile.
* @param string|null $filename If provided, uses a custom filename rather
* than looking in the default directory.
*
* @return callable
*/
public static function ini($profile = null, $filename = null)
{
$filename = $filename ?: (self::getDefaultConfigFilename());
$profile = $profile ?: (getenv(self::ENV_PROFILE) ?: 'aws_csm');
return function () use ($profile, $filename) {
if (!is_readable($filename)) {
return self::reject("Cannot read CSM config from $filename");
}
$data = \Aws\parse_ini_file($filename, true);
if ($data === false) {
return self::reject("Invalid config file: $filename");
}
if (!isset($data[$profile])) {
return self::reject("'$profile' not found in config file");
}
if (!isset($data[$profile]['csm_enabled'])) {
return self::reject("Required CSM config values not present in
INI profile '{$profile}' ({$filename})");
}
// host is optional
if (empty($data[$profile]['csm_host'])) {
$data[$profile]['csm_host'] = self::DEFAULT_HOST;
}
// port is optional
if (empty($data[$profile]['csm_port'])) {
$data[$profile]['csm_port'] = self::DEFAULT_PORT;
}
// client_id is optional
if (empty($data[$profile]['csm_client_id'])) {
$data[$profile]['csm_client_id'] = self::DEFAULT_CLIENT_ID;
}
return Promise\promise_for(
new Configuration(
$data[$profile]['csm_enabled'],
$data[$profile]['csm_host'],
$data[$profile]['csm_port'],
$data[$profile]['csm_client_id']
)
);
};
}
/**
* Unwraps a configuration object in whatever valid form it is in,
* always returning a ConfigurationInterface object.
*
* @param mixed $config
* @return ConfigurationInterface
* @throws \InvalidArgumentException
*/
public static function unwrap($config)
{
if (is_callable($config)) {
$config = $config();
}
if ($config instanceof PromiseInterface) {
$config = $config->wait();
}
if ($config instanceof ConfigurationInterface) {
return $config;
} elseif (is_array($config) && isset($config['enabled'])) {
$client_id = isset($config['client_id']) ? $config['client_id']
: self::DEFAULT_CLIENT_ID;
$host = isset($config['host']) ? $config['host']
: self::DEFAULT_HOST;
$port = isset($config['port']) ? $config['port']
: self::DEFAULT_PORT;
return new Configuration($config['enabled'], $host, $port, $client_id);
}
throw new \InvalidArgumentException('Not a valid CSM configuration '
. 'argument.');
}
}

View file

@ -0,0 +1,15 @@
<?php
namespace Aws\ClientSideMonitoring\Exception;
use Aws\HasMonitoringEventsTrait;
use Aws\MonitoringEventsInterface;
/**
* Represents an error interacting with configuration for client-side monitoring.
*/
class ConfigurationException extends \RuntimeException implements
MonitoringEventsInterface
{
use HasMonitoringEventsTrait;
}

View file

@ -0,0 +1,35 @@
<?php
namespace Aws\ClientSideMonitoring;
use Aws\CommandInterface;
use Aws\Exception\AwsException;
use Aws\ResultInterface;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
/**
* @internal
*/
interface MonitoringMiddlewareInterface
{
/**
* Data for event properties to be sent to the monitoring agent.
*
* @param RequestInterface $request
* @return array
*/
public static function getRequestData(RequestInterface $request);
/**
* Data for event properties to be sent to the monitoring agent.
*
* @param ResultInterface|AwsException|\Exception $klass
* @return array
*/
public static function getResponseData($klass);
public function __invoke(CommandInterface $cmd, RequestInterface $request);
}

View file

@ -21,6 +21,12 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeEnvironmentsAsync(array $args = [])
* @method \Aws\Result listEnvironments(array $args = [])
* @method \GuzzleHttp\Promise\Promise listEnvironmentsAsync(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 updateEnvironment(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateEnvironmentAsync(array $args = [])
* @method \Aws\Result updateEnvironmentMembership(array $args = [])

View file

@ -61,6 +61,10 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise getDirectoryAsync(array $args = [])
* @method \Aws\Result getFacet(array $args = [])
* @method \GuzzleHttp\Promise\Promise getFacetAsync(array $args = [])
* @method \Aws\Result getLinkAttributes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getLinkAttributesAsync(array $args = [])
* @method \Aws\Result getObjectAttributes(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectAttributesAsync(array $args = [])
* @method \Aws\Result getObjectInformation(array $args = [])
* @method \GuzzleHttp\Promise\Promise getObjectInformationAsync(array $args = [])
* @method \Aws\Result getSchemaAsJson(array $args = [])
@ -119,6 +123,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = [])
* @method \Aws\Result updateFacet(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateFacetAsync(array $args = [])
* @method \Aws\Result updateLinkAttributes(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateLinkAttributesAsync(array $args = [])
* @method \Aws\Result updateObjectAttributes(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateObjectAttributesAsync(array $args = [])
* @method \Aws\Result updateSchema(array $args = [])
@ -129,5 +135,7 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise upgradeAppliedSchemaAsync(array $args = [])
* @method \Aws\Result upgradePublishedSchema(array $args = [])
* @method \GuzzleHttp\Promise\Promise upgradePublishedSchemaAsync(array $args = [])
* @method \Aws\Result listManagedSchemaArns(array $args = []) (supported in versions 2017-01-11)
* @method \GuzzleHttp\Promise\Promise listManagedSchemaArnsAsync(array $args = []) (supported in versions 2017-01-11)
*/
class CloudDirectoryClient extends AwsClient {}

View file

@ -26,16 +26,22 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise deleteStackInstancesAsync(array $args = [])
* @method \Aws\Result deleteStackSet(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteStackSetAsync(array $args = [])
* @method \Aws\Result deregisterType(array $args = [])
* @method \GuzzleHttp\Promise\Promise deregisterTypeAsync(array $args = [])
* @method \Aws\Result describeAccountLimits(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAccountLimitsAsync(array $args = [])
* @method \Aws\Result describeChangeSet(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeChangeSetAsync(array $args = [])
* @method \Aws\Result describeStackDriftDetectionStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStackDriftDetectionStatusAsync(array $args = [])
* @method \Aws\Result describeStackEvents(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStackEventsAsync(array $args = [])
* @method \Aws\Result describeStackInstance(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStackInstanceAsync(array $args = [])
* @method \Aws\Result describeStackResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStackResourceAsync(array $args = [])
* @method \Aws\Result describeStackResourceDrifts(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStackResourceDriftsAsync(array $args = [])
* @method \Aws\Result describeStackResources(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStackResourcesAsync(array $args = [])
* @method \Aws\Result describeStackSet(array $args = [])
@ -44,6 +50,16 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeStackSetOperationAsync(array $args = [])
* @method \Aws\Result describeStacks(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeStacksAsync(array $args = [])
* @method \Aws\Result describeType(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeTypeAsync(array $args = [])
* @method \Aws\Result describeTypeRegistration(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeTypeRegistrationAsync(array $args = [])
* @method \Aws\Result detectStackDrift(array $args = [])
* @method \GuzzleHttp\Promise\Promise detectStackDriftAsync(array $args = [])
* @method \Aws\Result detectStackResourceDrift(array $args = [])
* @method \GuzzleHttp\Promise\Promise detectStackResourceDriftAsync(array $args = [])
* @method \Aws\Result detectStackSetDrift(array $args = [])
* @method \GuzzleHttp\Promise\Promise detectStackSetDriftAsync(array $args = [])
* @method \Aws\Result estimateTemplateCost(array $args = [])
* @method \GuzzleHttp\Promise\Promise estimateTemplateCostAsync(array $args = [])
* @method \Aws\Result executeChangeSet(array $args = [])
@ -72,8 +88,20 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listStackSetsAsync(array $args = [])
* @method \Aws\Result listStacks(array $args = [])
* @method \GuzzleHttp\Promise\Promise listStacksAsync(array $args = [])
* @method \Aws\Result listTypeRegistrations(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypeRegistrationsAsync(array $args = [])
* @method \Aws\Result listTypeVersions(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypeVersionsAsync(array $args = [])
* @method \Aws\Result listTypes(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTypesAsync(array $args = [])
* @method \Aws\Result recordHandlerProgress(array $args = [])
* @method \GuzzleHttp\Promise\Promise recordHandlerProgressAsync(array $args = [])
* @method \Aws\Result registerType(array $args = [])
* @method \GuzzleHttp\Promise\Promise registerTypeAsync(array $args = [])
* @method \Aws\Result setStackPolicy(array $args = [])
* @method \GuzzleHttp\Promise\Promise setStackPolicyAsync(array $args = [])
* @method \Aws\Result setTypeDefaultVersion(array $args = [])
* @method \GuzzleHttp\Promise\Promise setTypeDefaultVersionAsync(array $args = [])
* @method \Aws\Result signalResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise signalResourceAsync(array $args = [])
* @method \Aws\Result stopStackSetOperation(array $args = [])

View file

@ -50,18 +50,100 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise updateDistributionAsync(array $args = [])
* @method \Aws\Result updateStreamingDistribution(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateStreamingDistributionAsync(array $args = [])
* @method \Aws\Result createDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \GuzzleHttp\Promise\Promise createDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \Aws\Result createStreamingDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \GuzzleHttp\Promise\Promise createStreamingDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \Aws\Result listTagsForResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \Aws\Result tagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \Aws\Result untagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25)
* @method \Aws\Result createDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result createStreamingDistributionWithTags(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createStreamingDistributionWithTagsAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result listTagsForResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result tagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result untagResource(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise untagResourceAsync(array $args = []) (supported in versions 2016-08-01, 2016-08-20, 2016-09-07, 2016-09-29, 2016-11-25, 2017-03-25, 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result deleteServiceLinkedRole(array $args = []) (supported in versions 2017-03-25)
* @method \GuzzleHttp\Promise\Promise deleteServiceLinkedRoleAsync(array $args = []) (supported in versions 2017-03-25)
* @method \Aws\Result createFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result createFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result createPublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createPublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result deleteFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deleteFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result deleteFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deleteFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result deletePublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deletePublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result getFieldLevelEncryption(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getFieldLevelEncryptionAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result getFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result getFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result getFieldLevelEncryptionProfileConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getFieldLevelEncryptionProfileConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result getPublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getPublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result getPublicKeyConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getPublicKeyConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result listFieldLevelEncryptionConfigs(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listFieldLevelEncryptionConfigsAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result listFieldLevelEncryptionProfiles(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listFieldLevelEncryptionProfilesAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result listPublicKeys(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listPublicKeysAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result updateFieldLevelEncryptionConfig(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise updateFieldLevelEncryptionConfigAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result updateFieldLevelEncryptionProfile(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise updateFieldLevelEncryptionProfileAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result updatePublicKey(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \GuzzleHttp\Promise\Promise updatePublicKeyAsync(array $args = []) (supported in versions 2017-10-30, 2018-06-18, 2018-11-05, 2019-03-26, 2020-05-31)
* @method \Aws\Result createCachePolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result createMonitoringSubscription(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createMonitoringSubscriptionAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result createOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result createRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise createRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result deleteCachePolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deleteCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result deleteMonitoringSubscription(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deleteMonitoringSubscriptionAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result deleteOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deleteOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result deleteRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise deleteRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result getCachePolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result getCachePolicyConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getCachePolicyConfigAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result getMonitoringSubscription(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getMonitoringSubscriptionAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result getOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result getOriginRequestPolicyConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getOriginRequestPolicyConfigAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result getRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise getRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result listCachePolicies(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listCachePoliciesAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result listDistributionsByCachePolicyId(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listDistributionsByCachePolicyIdAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result listDistributionsByOriginRequestPolicyId(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listDistributionsByOriginRequestPolicyIdAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result listDistributionsByRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listDistributionsByRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result listOriginRequestPolicies(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listOriginRequestPoliciesAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result listRealtimeLogConfigs(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise listRealtimeLogConfigsAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result updateCachePolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise updateCachePolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result updateOriginRequestPolicy(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise updateOriginRequestPolicyAsync(array $args = []) (supported in versions 2020-05-31)
* @method \Aws\Result updateRealtimeLogConfig(array $args = []) (supported in versions 2020-05-31)
* @method \GuzzleHttp\Promise\Promise updateRealtimeLogConfigAsync(array $args = []) (supported in versions 2020-05-31)
*/
class CloudFrontClient extends AwsClient
{

View file

@ -7,7 +7,7 @@ namespace Aws\CloudFront;
class Signer
{
private $keyPairId;
private $pk;
private $pkHandle;
/**
* A signer for creating the signature values used in CloudFront signed URLs
@ -15,11 +15,12 @@ class Signer
*
* @param $keyPairId string ID of the key pair
* @param $privateKey string Path to the private key used for signing
* @param $passphrase string Passphrase to private key file, if one exists
*
* @throws \RuntimeException if the openssl extension is missing
* @throws \InvalidArgumentException if the private key cannot be found.
*/
public function __construct($keyPairId, $privateKey)
public function __construct($keyPairId, $privateKey, $passphrase = "")
{
if (!extension_loaded('openssl')) {
//@codeCoverageIgnoreStart
@ -30,13 +31,22 @@ class Signer
$this->keyPairId = $keyPairId;
if (!file_exists($privateKey)) {
throw new \InvalidArgumentException("PK file not found: $privateKey");
if (!$this->pkHandle = openssl_pkey_get_private($privateKey, $passphrase)) {
if (!file_exists($privateKey)) {
throw new \InvalidArgumentException("PK file not found: $privateKey");
} else {
$this->pkHandle = openssl_pkey_get_private("file://$privateKey", $passphrase);
if (!$this->pkHandle) {
throw new \InvalidArgumentException(openssl_error_string());
}
}
}
$this->pk = file_get_contents($privateKey);
}
public function __destruct()
{
$this->pkHandle && openssl_pkey_free($this->pkHandle);
}
/**
* Create the values used to construct signed URLs and cookies.
@ -66,6 +76,7 @@ class Signer
$policy = preg_replace('/\s/s', '', $policy);
$signatureHash['Policy'] = $this->encode($policy);
} elseif ($resource && $expires) {
$expires = (int) $expires; // Handle epoch passed as string
$policy = $this->createCannedPolicy($resource, $expires);
$signatureHash['Expires'] = $expires;
} else {
@ -96,7 +107,7 @@ class Signer
private function sign($policy)
{
$signature = '';
openssl_sign($policy, $signature, $this->pk);
openssl_sign($policy, $signature, $this->pkHandle);
return $signature;
}

View file

@ -5,10 +5,14 @@ use Aws\AwsClient;
/**
* This client is used to interact with the **AWS CloudHSM V2** service.
* @method \Aws\Result copyBackupToRegion(array $args = [])
* @method \GuzzleHttp\Promise\Promise copyBackupToRegionAsync(array $args = [])
* @method \Aws\Result createCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise createClusterAsync(array $args = [])
* @method \Aws\Result createHsm(array $args = [])
* @method \GuzzleHttp\Promise\Promise createHsmAsync(array $args = [])
* @method \Aws\Result deleteBackup(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteBackupAsync(array $args = [])
* @method \Aws\Result deleteCluster(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteClusterAsync(array $args = [])
* @method \Aws\Result deleteHsm(array $args = [])
@ -21,6 +25,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise initializeClusterAsync(array $args = [])
* @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result restoreBackup(array $args = [])
* @method \GuzzleHttp\Promise\Promise restoreBackupAsync(array $args = [])
* @method \Aws\Result tagResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise tagResourceAsync(array $args = [])
* @method \Aws\Result untagResource(array $args = [])

View file

@ -29,8 +29,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeHsmAsync(array $args = [])
* @method \Aws\Result describeLunaClient(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeLunaClientAsync(array $args = [])
* @method \Aws\Result getConfig(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConfigAsync(array $args = [])
* @method \Aws\Result getConfigFiles(array $args = [])
* @method \GuzzleHttp\Promise\Promise getConfigFilesAsync(array $args = [])
* @method \Aws\Result listAvailableZones(array $args = [])
* @method \GuzzleHttp\Promise\Promise listAvailableZonesAsync(array $args = [])
* @method \Aws\Result listHapgs(array $args = [])
@ -50,35 +50,4 @@ use Aws\AwsClient;
* @method \Aws\Result removeTagsFromResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeTagsFromResourceAsync(array $args = [])
*/
class CloudHsmClient extends AwsClient
{
public function __call($name, array $args)
{
// Overcomes a naming collision with `AwsClient::getConfig`.
if (lcfirst($name) === 'getConfigFiles') {
$name = 'GetConfig';
} elseif (lcfirst($name) === 'getConfigFilesAsync') {
$name = 'GetConfigAsync';
}
return parent::__call($name, $args);
}
/**
* @internal
* @codeCoverageIgnore
*/
public static function applyDocFilters(array $api, array $docs)
{
// Overcomes a naming collision with `AwsClient::getConfig`.
$api['operations']['GetConfigFiles'] = $api['operations']['GetConfig'];
$docs['operations']['GetConfigFiles'] = $docs['operations']['GetConfig'];
unset($api['operations']['GetConfig'], $docs['operations']['GetConfig']);
ksort($api['operations']);
return [
new Service($api, ApiProvider::defaultProvider()),
new DocModel($docs)
];
}
}
class CloudHsmClient extends AwsClient {}

View file

@ -32,6 +32,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeAnalysisSchemesAsync(array $args = [])
* @method \Aws\Result describeAvailabilityOptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAvailabilityOptionsAsync(array $args = [])
* @method \Aws\Result describeDomainEndpointOptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeDomainEndpointOptionsAsync(array $args = [])
* @method \Aws\Result describeDomains(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeDomainsAsync(array $args = [])
* @method \Aws\Result describeExpressions(array $args = [])
@ -50,6 +52,8 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise listDomainNamesAsync(array $args = [])
* @method \Aws\Result updateAvailabilityOptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateAvailabilityOptionsAsync(array $args = [])
* @method \Aws\Result updateDomainEndpointOptions(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateDomainEndpointOptionsAsync(array $args = [])
* @method \Aws\Result updateScalingParameters(array $args = [])
* @method \GuzzleHttp\Promise\Promise updateScalingParametersAsync(array $args = [])
* @method \Aws\Result updateServiceAccessPolicies(array $args = [])

View file

@ -16,16 +16,24 @@ use Aws\AwsClient;
* @method \GuzzleHttp\Promise\Promise describeTrailsAsync(array $args = [])
* @method \Aws\Result getEventSelectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise getEventSelectorsAsync(array $args = [])
* @method \Aws\Result getInsightSelectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise getInsightSelectorsAsync(array $args = [])
* @method \Aws\Result getTrail(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTrailAsync(array $args = [])
* @method \Aws\Result getTrailStatus(array $args = [])
* @method \GuzzleHttp\Promise\Promise getTrailStatusAsync(array $args = [])
* @method \Aws\Result listPublicKeys(array $args = [])
* @method \GuzzleHttp\Promise\Promise listPublicKeysAsync(array $args = [])
* @method \Aws\Result listTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsAsync(array $args = [])
* @method \Aws\Result listTrails(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTrailsAsync(array $args = [])
* @method \Aws\Result lookupEvents(array $args = [])
* @method \GuzzleHttp\Promise\Promise lookupEventsAsync(array $args = [])
* @method \Aws\Result putEventSelectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise putEventSelectorsAsync(array $args = [])
* @method \Aws\Result putInsightSelectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise putInsightSelectorsAsync(array $args = [])
* @method \Aws\Result removeTags(array $args = [])
* @method \GuzzleHttp\Promise\Promise removeTagsAsync(array $args = [])
* @method \Aws\Result startLogging(array $args = [])

View file

@ -8,33 +8,63 @@ use Aws\AwsClient;
*
* @method \Aws\Result deleteAlarms(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAlarmsAsync(array $args = [])
* @method \Aws\Result deleteAnomalyDetector(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteAnomalyDetectorAsync(array $args = [])
* @method \Aws\Result deleteDashboards(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteDashboardsAsync(array $args = [])
* @method \Aws\Result deleteInsightRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise deleteInsightRulesAsync(array $args = [])
* @method \Aws\Result describeAlarmHistory(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAlarmHistoryAsync(array $args = [])
* @method \Aws\Result describeAlarms(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAlarmsAsync(array $args = [])
* @method \Aws\Result describeAlarmsForMetric(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAlarmsForMetricAsync(array $args = [])
* @method \Aws\Result describeAnomalyDetectors(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeAnomalyDetectorsAsync(array $args = [])
* @method \Aws\Result describeInsightRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise describeInsightRulesAsync(array $args = [])
* @method \Aws\Result disableAlarmActions(array $args = [])
* @method \GuzzleHttp\Promise\Promise disableAlarmActionsAsync(array $args = [])
* @method \Aws\Result disableInsightRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise disableInsightRulesAsync(array $args = [])
* @method \Aws\Result enableAlarmActions(array $args = [])
* @method \GuzzleHttp\Promise\Promise enableAlarmActionsAsync(array $args = [])
* @method \Aws\Result enableInsightRules(array $args = [])
* @method \GuzzleHttp\Promise\Promise enableInsightRulesAsync(array $args = [])
* @method \Aws\Result getDashboard(array $args = [])
* @method \GuzzleHttp\Promise\Promise getDashboardAsync(array $args = [])
* @method \Aws\Result getInsightRuleReport(array $args = [])
* @method \GuzzleHttp\Promise\Promise getInsightRuleReportAsync(array $args = [])
* @method \Aws\Result getMetricData(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMetricDataAsync(array $args = [])
* @method \Aws\Result getMetricStatistics(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMetricStatisticsAsync(array $args = [])
* @method \Aws\Result getMetricWidgetImage(array $args = [])
* @method \GuzzleHttp\Promise\Promise getMetricWidgetImageAsync(array $args = [])
* @method \Aws\Result listDashboards(array $args = [])
* @method \GuzzleHttp\Promise\Promise listDashboardsAsync(array $args = [])
* @method \Aws\Result listMetrics(array $args = [])
* @method \GuzzleHttp\Promise\Promise listMetricsAsync(array $args = [])
* @method \Aws\Result listTagsForResource(array $args = [])
* @method \GuzzleHttp\Promise\Promise listTagsForResourceAsync(array $args = [])
* @method \Aws\Result putAnomalyDetector(array $args = [])
* @method \GuzzleHttp\Promise\Promise putAnomalyDetectorAsync(array $args = [])
* @method \Aws\Result putCompositeAlarm(array $args = [])
* @method \GuzzleHttp\Promise\Promise putCompositeAlarmAsync(array $args = [])
* @method \Aws\Result putDashboard(array $args = [])
* @method \GuzzleHttp\Promise\Promise putDashboardAsync(array $args = [])
* @method \Aws\Result putInsightRule(array $args = [])
* @method \GuzzleHttp\Promise\Promise putInsightRuleAsync(array $args = [])
* @method \Aws\Result putMetricAlarm(array $args = [])
* @method \GuzzleHttp\Promise\Promise putMetricAlarmAsync(array $args = [])
* @method \Aws\Result putMetricData(array $args = [])
* @method \GuzzleHttp\Promise\Promise putMetricDataAsync(array $args = [])
* @method \Aws\Result setAlarmState(array $args = [])
* @method \GuzzleHttp\Promise\Promise setAlarmStateAsync(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 CloudWatchClient extends AwsClient {}

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