| 1 |
<?php |
| 2 |
|
| 3 |
namespace Dudlewebs\WPMCS\s3\Aws; |
| 4 |
|
| 5 |
use Dudlewebs\WPMCS\s3\Psr\Http\Message\UriInterface; |
| 6 |
use Dudlewebs\WPMCS\s3\GuzzleHttp\Promise\PromiseInterface; |
| 7 |
/** |
| 8 |
* Represents an AWS client. |
| 9 |
*/ |
| 10 |
interface AwsClientInterface |
| 11 |
{ |
| 12 |
/** |
| 13 |
* Creates and executes a command for an operation by name. |
| 14 |
* |
| 15 |
* Suffixing an operation name with "Async" will return a |
| 16 |
* promise that can be used to execute commands asynchronously. |
| 17 |
* |
| 18 |
* @param string $name Name of the command to execute. |
| 19 |
* @param array $arguments Arguments to pass to the getCommand method. |
| 20 |
* |
| 21 |
* @return ResultInterface |
| 22 |
* @throws \Exception |
| 23 |
*/ |
| 24 |
public function __call($name, array $arguments); |
| 25 |
/** |
| 26 |
* Create a command for an operation name. |
| 27 |
* |
| 28 |
* Special keys may be set on the command to control how it behaves, |
| 29 |
* including: |
| 30 |
* |
| 31 |
* - @http: Associative array of transfer specific options to apply to the |
| 32 |
* request that is serialized for this command. Available keys include |
| 33 |
* "proxy", "verify", "timeout", "connect_timeout", "debug", "delay", and |
| 34 |
* "headers". |
| 35 |
* |
| 36 |
* @param string $name Name of the operation to use in the command |
| 37 |
* @param array $args Arguments to pass to the command |
| 38 |
* |
| 39 |
* @return CommandInterface |
| 40 |
* @throws \InvalidArgumentException if no command can be found by name |
| 41 |
*/ |
| 42 |
public function getCommand($name, array $args = []); |
| 43 |
/** |
| 44 |
* Execute a single command. |
| 45 |
* |
| 46 |
* @param CommandInterface $command Command to execute |
| 47 |
* |
| 48 |
* @return ResultInterface |
| 49 |
* @throws \Exception |
| 50 |
*/ |
| 51 |
public function execute(CommandInterface $command); |
| 52 |
/** |
| 53 |
* Execute a command asynchronously. |
| 54 |
* |
| 55 |
* @param CommandInterface $command Command to execute |
| 56 |
* |
| 57 |
* @return \GuzzleHttp\Promise\PromiseInterface |
| 58 |
*/ |
| 59 |
public function executeAsync(CommandInterface $command); |
| 60 |
/** |
| 61 |
* Returns a promise that is fulfilled with an |
| 62 |
* {@see \Aws\Credentials\CredentialsInterface} object. |
| 63 |
* |
| 64 |
* If you need the credentials synchronously, then call the wait() method |
| 65 |
* on the returned promise. |
| 66 |
* |
| 67 |
* @return PromiseInterface |
| 68 |
*/ |
| 69 |
public function getCredentials(); |
| 70 |
/** |
| 71 |
* Get the region to which the client is configured to send requests. |
| 72 |
* |
| 73 |
* @return string |
| 74 |
*/ |
| 75 |
public function getRegion(); |
| 76 |
/** |
| 77 |
* Gets the default endpoint, or base URL, used by the client. |
| 78 |
* |
| 79 |
* @return UriInterface |
| 80 |
*/ |
| 81 |
public function getEndpoint(); |
| 82 |
/** |
| 83 |
* Get the service description associated with the client. |
| 84 |
* |
| 85 |
* @return \Aws\Api\Service |
| 86 |
*/ |
| 87 |
public function getApi(); |
| 88 |
/** |
| 89 |
* Get a client configuration value. |
| 90 |
* |
| 91 |
* @param string|null $option The option to retrieve. Pass null to retrieve |
| 92 |
* all options. |
| 93 |
* @return mixed|null |
| 94 |
*/ |
| 95 |
public function getConfig($option = null); |
| 96 |
/** |
| 97 |
* Get the handler list used to transfer commands. |
| 98 |
* |
| 99 |
* This list can be modified to add middleware or to change the underlying |
| 100 |
* handler used to send HTTP requests. |
| 101 |
* |
| 102 |
* @return HandlerList |
| 103 |
*/ |
| 104 |
public function getHandlerList(); |
| 105 |
/** |
| 106 |
* Get a resource iterator for the specified operation. |
| 107 |
* |
| 108 |
* @param string $name Name of the iterator to retrieve. |
| 109 |
* @param array $args Command arguments to use with each command. |
| 110 |
* |
| 111 |
* @return \Iterator |
| 112 |
* @throws \UnexpectedValueException if the iterator config is invalid. |
| 113 |
*/ |
| 114 |
public function getIterator($name, array $args = []); |
| 115 |
/** |
| 116 |
* Get a result paginator for the specified operation. |
| 117 |
* |
| 118 |
* @param string $name Name of the operation used for iterator |
| 119 |
* @param array $args Command args to be used with each command |
| 120 |
* |
| 121 |
* @return \Aws\ResultPaginator |
| 122 |
* @throws \UnexpectedValueException if the iterator config is invalid. |
| 123 |
*/ |
| 124 |
public function getPaginator($name, array $args = []); |
| 125 |
/** |
| 126 |
* Wait until a resource is in a particular state. |
| 127 |
* |
| 128 |
* @param string|callable $name Name of the waiter that defines the wait |
| 129 |
* configuration and conditions. |
| 130 |
* @param array $args Args to be used with each command executed |
| 131 |
* by the waiter. Waiter configuration options |
| 132 |
* can be provided in an associative array in |
| 133 |
* the @waiter key. |
| 134 |
* @return void |
| 135 |
* @throws \UnexpectedValueException if the waiter is invalid. |
| 136 |
*/ |
| 137 |
public function waitUntil($name, array $args = []); |
| 138 |
/** |
| 139 |
* Get a waiter that waits until a resource is in a particular state. |
| 140 |
* |
| 141 |
* Retrieving a waiter can be useful when you wish to wait asynchronously: |
| 142 |
* |
| 143 |
* $waiter = $client->getWaiter('foo', ['bar' => 'baz']); |
| 144 |
* $waiter->promise()->then(function () { echo 'Done!'; }); |
| 145 |
* |
| 146 |
* @param string|callable $name Name of the waiter that defines the wait |
| 147 |
* configuration and conditions. |
| 148 |
* @param array $args Args to be used with each command executed |
| 149 |
* by the waiter. Waiter configuration options |
| 150 |
* can be provided in an associative array in |
| 151 |
* the @waiter key. |
| 152 |
* @return \Aws\Waiter |
| 153 |
* @throws \UnexpectedValueException if the waiter is invalid. |
| 154 |
*/ |
| 155 |
public function getWaiter($name, array $args = []); |
| 156 |
} |
| 157 |
|