Example #1
0
 /**
  * Returns a service model and doc model with any necessary changes
  * applied.
  *
  * @param array $api  Array of service data being documented.
  * @param array $docs Array of doc model data.
  *
  * @return array Tuple containing a [Service, DocModel]
  *
  * @internal This should only used to document the service API.
  * @codeCoverageIgnore
  */
 public static function applyDocFilters(array $api, array $docs)
 {
     return [new Service($api, ApiProvider::defaultProvider()), new DocModel($docs)];
 }
    public static function _missing_version(array $args)
    {
        $service = isset($args['service']) ? $args['service'] : '';
        $versions = ApiProvider::defaultProvider($args)->getVersions($service);
        $versions = implode("\n", array_map(function ($v) {
            return "* \"{$v}\"";
        }, $versions)) ?: '* (none found)';
        return <<<EOT
A "version" configuration value is required. Specifying a version constraint
ensures that your code will not be affected by a breaking change made to the
service. For example, when using Amazon S3, you can lock your API version to
"2006-03-01".

Your build of the SDK has the following version(s) of "{$service}": {$versions}

You may provide "latest" to the "version" configuration value to utilize the
most recent available API version that your client's API provider can find.
Note: Using 'latest' in a production application is not recommended.

A list of available API versions can be found on each client's API documentation
page: http://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html. If you are
unable to load a specific API version, then you may need to update your copy of
the SDK.
EOT;
    }