AwsClientInterface
extends
ClientInterface
in
Interface that all AWS clients implement
Table of Contents
Constants
- CREATE_REQUEST = 'client.create_request'
- HTTP_DATE = 'D, d M Y H:i:s \G\M\T'
Methods
- addSubscriber() : self
- Add an event subscriber to the dispatcher
- createRequest() : RequestInterface
- Create and return a new {@see RequestInterface} configured for the client.
- delete() : EntityEnclosingRequestInterface
- Create a DELETE request for the client
- dispatch() : Event
- Helper to dispatch Guzzle events and set the event name on the event
- execute() : mixed
- Execute one or more commands
- factory() : FromConfigInterface
- Static factory method used to turn an array or collection of configuration data into an instantiated object.
- get() : RequestInterface
- Create a GET request for the client
- getAllEvents() : array<string|int, mixed>
- Get a list of all of the events emitted from the class
- getApiVersion() : string
- Get the API version of the client (e.g. 2006-03-01)
- getBaseUrl() : string|null
- Get the client's base URL as either an expanded or raw URI template
- getCommand() : CommandInterface
- Get a command by name. First, the client will see if it has a service description and if the service description defines a command by the supplied name. If no dynamic command is found, the client will look for a concrete command class exists matching the name supplied. If neither are found, an InvalidArgumentException is thrown.
- getConfig() : mixed|Collection
- Get a configuration setting or all of the configuration settings. The Collection result of this method can be modified to change the configuration settings of a client.
- getCredentials() : CredentialsInterface
- Returns the AWS credentials associated with the client
- getDescription() : ServiceDescriptionInterface|null
- Get the service description of the client
- getEventDispatcher() : EventDispatcherInterface
- Get the EventDispatcher of the request
- getIterator() : ResourceIteratorInterface
- Get a resource iterator from the client.
- getRegion() : string
- Get the name of the region to which the client is configured to send requests
- getRegions() : array<string|int, mixed>
- Get a list of available regions and region data
- getSignature() : SignatureInterface
- Returns the signature implementation used with the client
- getWaiter() : WaiterInterface
- Get a named waiter object
- getWaiterFactory() : WaiterFactoryInterface
- Get the waiter factory being used by the client
- head() : RequestInterface
- Create a HEAD request for the client
- options() : RequestInterface
- Create an OPTIONS request for the client
- patch() : EntityEnclosingRequestInterface
- Create a PATCH request for the client
- post() : EntityEnclosingRequestInterface
- Create a POST request for the client
- put() : EntityEnclosingRequestInterface
- Create a PUT request for the client
- send() : Response|array<string|int, mixed>
- Sends a single request or an array of requests in parallel
- setBaseUrl() : self
- Set the base URL of the client
- setConfig() : self
- Set the configuration object to use with the client
- setCredentials() : self
- Sets the credentials object associated with the client
- setDescription() : ClientInterface
- Set the service description of the client
- setEventDispatcher() : self
- Set the EventDispatcher of the request
- setRegion() : self
- Change the region to which the client is configured to send requests
- setSslVerification() : self
- Set SSL verification options.
- setUserAgent() : self
- Set the User-Agent header to be used on all requests from the client
- setWaiterFactory() : self
- Set the waiter factory to use with the client
- waitUntil() : self
- Wait until a resource is available or an associated waiter returns true
Constants
CREATE_REQUEST
public
mixed
CREATE_REQUEST
= 'client.create_request'
HTTP_DATE
public
string
HTTP_DATE
= 'D, d M Y H:i:s \G\M\T'
RFC 1123 HTTP-Date
Methods
addSubscriber()
Add an event subscriber to the dispatcher
public
addSubscriber(EventSubscriberInterface $subscriber) : self
Parameters
- $subscriber : EventSubscriberInterface
-
Event subscriber
Return values
selfcreateRequest()
Create and return a new {@see RequestInterface} configured for the client.
public
createRequest([string $method = RequestInterface::GET ][, string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, string|resource|array<string|int, mixed>|EntityBodyInterface $body = null ][, array<string|int, mixed> $options = array() ]) : RequestInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URI can contain the query string as well. Use an array to provide a URI template and additional variables to use in the URI template expansion.
Parameters
- $method : string = RequestInterface::GET
-
HTTP method. Defaults to GET
- $uri : string|array<string|int, mixed> = null
-
Resource URI.
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $body : string|resource|array<string|int, mixed>|EntityBodyInterface = null
-
Entity body of request (POST/PUT) or response (GET)
- $options : array<string|int, mixed> = array()
-
Array of options to apply to the request
Tags
Return values
RequestInterfacedelete()
Create a DELETE request for the client
public
delete([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, string|resource|EntityBodyInterface $body = null ][, array<string|int, mixed> $options = array() ]) : EntityEnclosingRequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $body : string|resource|EntityBodyInterface = null
-
Body to send in the request
- $options : array<string|int, mixed> = array()
-
Options to apply to the request
Tags
Return values
EntityEnclosingRequestInterfacedispatch()
Helper to dispatch Guzzle events and set the event name on the event
public
dispatch(string $eventName[, array<string|int, mixed> $context = array() ]) : Event
Parameters
- $eventName : string
-
Name of the event to dispatch
- $context : array<string|int, mixed> = array()
-
Context of the event
Return values
Event —Returns the created event object
execute()
Execute one or more commands
public
execute(CommandInterface|array<string|int, mixed>|Traversable $command) : mixed
Parameters
- $command : CommandInterface|array<string|int, mixed>|Traversable
-
Command, array of commands or Traversable object containing commands to execute
Tags
Return values
mixed —Returns the result of the executed command or an array of commands if executing multiple commands
factory()
Static factory method used to turn an array or collection of configuration data into an instantiated object.
public
static factory([array<string|int, mixed>|Collection $config = array() ]) : FromConfigInterface
Parameters
- $config : array<string|int, mixed>|Collection = array()
-
Configuration data
Return values
FromConfigInterfaceget()
Create a GET request for the client
public
get([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, array<string|int, mixed> $options = array() ]) : RequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $options : array<string|int, mixed> = array()
-
Options to apply to the request. For BC compatibility, you can also pass a string to tell Guzzle to download the body of the response to a particular location. Use the 'body' option instead for forward compatibility.
Tags
Return values
RequestInterfacegetAllEvents()
Get a list of all of the events emitted from the class
public
static getAllEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>getApiVersion()
Get the API version of the client (e.g. 2006-03-01)
public
getApiVersion() : string
Return values
stringgetBaseUrl()
Get the client's base URL as either an expanded or raw URI template
public
getBaseUrl([bool $expand = true ]) : string|null
Parameters
- $expand : bool = true
-
Set to FALSE to get the raw base URL without URI template expansion
Return values
string|nullgetCommand()
Get a command by name. First, the client will see if it has a service description and if the service description defines a command by the supplied name. If no dynamic command is found, the client will look for a concrete command class exists matching the name supplied. If neither are found, an InvalidArgumentException is thrown.
public
getCommand(string $name[, array<string|int, mixed> $args = array() ]) : CommandInterface
Parameters
- $name : string
-
Name of the command to retrieve
- $args : array<string|int, mixed> = array()
-
Arguments to pass to the command
Tags
Return values
CommandInterfacegetConfig()
Get a configuration setting or all of the configuration settings. The Collection result of this method can be modified to change the configuration settings of a client.
public
getConfig([bool|string $key = false ]) : mixed|Collection
A client should honor the following special values:
- request.options: Associative array of default RequestFactory options to apply to each request
- request.params: Associative array of request parameters (data values) to apply to each request
- curl.options: Associative array of cURL configuration settings to apply to each request
- ssl.certificate_authority: Path a CAINFO, CAPATH, true to use strict defaults, or false to disable verification
- redirect.disable: Set to true to disable redirects
Parameters
- $key : bool|string = false
-
Configuration value to retrieve. Set to FALSE to retrieve all values of the client. The object return can be modified, and modifications will affect the client's config.
Tags
Return values
mixed|CollectiongetCredentials()
Returns the AWS credentials associated with the client
public
getCredentials() : CredentialsInterface
Return values
CredentialsInterfacegetDescription()
Get the service description of the client
public
getDescription() : ServiceDescriptionInterface|null
Return values
ServiceDescriptionInterface|nullgetEventDispatcher()
Get the EventDispatcher of the request
public
getEventDispatcher() : EventDispatcherInterface
Return values
EventDispatcherInterfacegetIterator()
Get a resource iterator from the client.
public
getIterator(string|CommandInterface $command[, array<string|int, mixed> $commandOptions = null ][, array<string|int, mixed> $iteratorOptions = array() ]) : ResourceIteratorInterface
Parameters
- $command : string|CommandInterface
-
Command class or command name.
- $commandOptions : array<string|int, mixed> = null
-
Command options used when creating commands.
- $iteratorOptions : array<string|int, mixed> = array()
-
Iterator options passed to the iterator when it is instantiated.
Return values
ResourceIteratorInterfacegetRegion()
Get the name of the region to which the client is configured to send requests
public
getRegion() : string
Return values
stringgetRegions()
Get a list of available regions and region data
public
getRegions() : array<string|int, mixed>
Return values
array<string|int, mixed>getSignature()
Returns the signature implementation used with the client
public
getSignature() : SignatureInterface
Return values
SignatureInterfacegetWaiter()
Get a named waiter object
public
getWaiter(string $waiter[, array<string|int, mixed> $input = array() ]) : WaiterInterface
Parameters
- $waiter : string
-
Name of the waiter
- $input : array<string|int, mixed> = array()
-
Values used as input for the underlying operation and to control the waiter
Return values
WaiterInterfacegetWaiterFactory()
Get the waiter factory being used by the client
public
getWaiterFactory() : WaiterFactoryInterface
Return values
WaiterFactoryInterfacehead()
Create a HEAD request for the client
public
head([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, array<string|int, mixed> $options = array() ]) : RequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $options : array<string|int, mixed> = array()
-
Options to apply to the request
Tags
Return values
RequestInterfaceoptions()
Create an OPTIONS request for the client
public
options([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed> $options = array() ]) : RequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $options : array<string|int, mixed> = array()
-
Options to apply to the request
Tags
Return values
RequestInterfacepatch()
Create a PATCH request for the client
public
patch([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, string|resource|EntityBodyInterface $body = null ][, array<string|int, mixed> $options = array() ]) : EntityEnclosingRequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $body : string|resource|EntityBodyInterface = null
-
Body to send in the request
- $options : array<string|int, mixed> = array()
-
Options to apply to the request
Tags
Return values
EntityEnclosingRequestInterfacepost()
Create a POST request for the client
public
post([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, array<string|int, mixed>|Collection|string|EntityBodyInterface $postBody = null ][, array<string|int, mixed> $options = array() ]) : EntityEnclosingRequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $postBody : array<string|int, mixed>|Collection|string|EntityBodyInterface = null
-
POST body. Can be a string, EntityBody, or associative array of POST fields to send in the body of the request. Prefix a value in the array with the @ symbol to reference a file.
- $options : array<string|int, mixed> = array()
-
Options to apply to the request
Tags
Return values
EntityEnclosingRequestInterfaceput()
Create a PUT request for the client
public
put([string|array<string|int, mixed> $uri = null ][, array<string|int, mixed>|Collection $headers = null ][, string|resource|EntityBodyInterface $body = null ][, array<string|int, mixed> $options = array() ]) : EntityEnclosingRequestInterface
Parameters
- $uri : string|array<string|int, mixed> = null
-
Resource URI
- $headers : array<string|int, mixed>|Collection = null
-
HTTP headers
- $body : string|resource|EntityBodyInterface = null
-
Body to send in the request
- $options : array<string|int, mixed> = array()
-
Options to apply to the request
Tags
Return values
EntityEnclosingRequestInterfacesend()
Sends a single request or an array of requests in parallel
public
send(array<string|int, mixed>|RequestInterface $requests) : Response|array<string|int, mixed>
Parameters
- $requests : array<string|int, mixed>|RequestInterface
-
One or more RequestInterface objects to send
Return values
Response|array<string|int, mixed> —Returns a single Response or an array of Response objects
setBaseUrl()
Set the base URL of the client
public
setBaseUrl(string $url) : self
Parameters
- $url : string
-
The base service endpoint URL of the webservice
Return values
selfsetConfig()
Set the configuration object to use with the client
public
setConfig(array<string|int, mixed>|Collection $config) : self
Parameters
- $config : array<string|int, mixed>|Collection
-
Parameters that define how the client behaves
Return values
selfsetCredentials()
Sets the credentials object associated with the client
public
setCredentials(CredentialsInterface $credentials) : self
Parameters
- $credentials : CredentialsInterface
-
Credentials object to use
Return values
selfsetDescription()
Set the service description of the client
public
setDescription(ServiceDescriptionInterface $service) : ClientInterface
Parameters
- $service : ServiceDescriptionInterface
-
Service description
Return values
ClientInterfacesetEventDispatcher()
Set the EventDispatcher of the request
public
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : self
Parameters
- $eventDispatcher : EventDispatcherInterface
Return values
selfsetRegion()
Change the region to which the client is configured to send requests
public
setRegion(string $region) : self
Parameters
- $region : string
-
Name of the region
Return values
selfsetSslVerification()
Set SSL verification options.
public
setSslVerification([string|bool $certificateAuthority = true ][, bool $verifyPeer = true ][, int $verifyHost = 2 ]) : self
Setting $certificateAuthority to TRUE will result in the bundled cacert.pem being used to verify against the remote host.
Alternate certificates to verify against can be specified with the $certificateAuthority option set to the full path to a certificate file, or the path to a directory containing certificates.
Setting $certificateAuthority to FALSE will turn off peer verification, unset the bundled cacert.pem, and disable host verification. Please don't do this unless you really know what you're doing, and why you're doing it.
Parameters
- $certificateAuthority : string|bool = true
-
bool, file path, or directory path
- $verifyPeer : bool = true
-
FALSE to stop from verifying the peer's certificate.
- $verifyHost : int = 2
-
Set to 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that it matches the hostname provided.
Return values
selfsetUserAgent()
Set the User-Agent header to be used on all requests from the client
public
setUserAgent(string $userAgent[, bool $includeDefault = false ]) : self
Parameters
- $userAgent : string
-
User agent string
- $includeDefault : bool = false
-
Set to true to prepend the value to Guzzle's default user agent string
Return values
selfsetWaiterFactory()
Set the waiter factory to use with the client
public
setWaiterFactory(WaiterFactoryInterface $waiterFactory) : self
Parameters
- $waiterFactory : WaiterFactoryInterface
-
Factory used to create waiters
Return values
selfwaitUntil()
Wait until a resource is available or an associated waiter returns true
public
waitUntil(string $waiter[, array<string|int, mixed> $input = array() ]) : self
Parameters
- $waiter : string
-
Name of the waiter
- $input : array<string|int, mixed> = array()
-
Values used as input for the underlying operation and to control the waiter