Esempio n. 1
0
 public function __construct(array $config)
 {
     parent::__construct($config);
     $list = $this->getHandlerList();
     $list->appendBuild($this->queueUrl(), 'sqs.queue_url');
     $list->appendSign($this->validateMd5(), 'sqs.md5');
 }
 public static function getArguments()
 {
     $args = parent::getArguments();
     $args['retries']['default'] = 11;
     $args['retries']['fn'] = [DynamoDbClient::class, '_applyRetryConfig'];
     return $args;
 }
Esempio n. 3
0
 public static function getArguments()
 {
     $args = parent::getArguments();
     $args['retries']['default'] = 10;
     $args['retries']['fn'] = [__CLASS__, '_applyRetryConfig'];
     $args['api_provider']['fn'] = [__CLASS__, '_applyApiProvider'];
     return $args;
 }
Esempio n. 4
0
 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);
 }
 public static function getArguments()
 {
     $args = parent::getArguments();
     $args['endpoint']['required'] = true;
     $args['region']['default'] = function (array $args) {
         // Determine the region from the provided endpoint.
         // (e.g. http://search-blah.{region}.cloudsearch.amazonaws.com)
         return explode('.', new Uri($args['endpoint']))[1];
     };
     return $args;
 }
 public function __construct(array $config)
 {
     parent::__construct($config);
     $list = $this->getHandlerList();
     $list->appendBuild($this->predictEndpoint(), 'ml.predict_endpoint');
 }
Esempio n. 7
0
 public function __construct(array $args)
 {
     $args['with_resolved'] = function (array $args) {
         $this->getHandlerList()->appendInit(CopySnapshotMiddleware::wrap($this, $args['endpoint_provider']), 'ec2.copy_snapshot');
     };
     parent::__construct($args);
 }
Esempio n. 8
0
 /**
  * {@inheritdoc}
  *
  * Sets the default accountId to "-" for all operations.
  */
 public function getCommand($name, array $args = [])
 {
     return parent::getCommand($name, $args + ['accountId' => '-']);
 }
Esempio n. 9
0
 /**
  * {@inheritdoc}
  *
  * In addition to the options available to
  * {@see Aws\AwsClient::__construct}, S3Client accepts the following
  * options:
  *
  * - bucket_endpoint: (bool) Set to true to send requests to a
  *   hardcoded bucket endpoint rather than create an endpoint as a result
  *   of injecting the bucket into the URL. This option is useful for
  *   interacting with CNAME endpoints.
  * - calculate_md5: (bool) Set to false to disable calculating an MD5
  *   for all Amazon S3 signed uploads.
  * - use_accelerate_endpoint: (bool) Set to true to send requests to an S3
  *   Accelerate endpoint by default. Can be enabled or disabled on
  *   individual operations by setting '@use_accelerate_endpoint' to true or
  *   false. Note: you must enable S3 Accelerate on a bucket before it can be
  *   accessed via an Accelerate endpoint.
  *
  * @param array $args
  */
 public function __construct(array $args)
 {
     parent::__construct($args);
     $stack = $this->getHandlerList();
     $stack->appendInit(SSECMiddleware::wrap($this->getEndpoint()->getScheme()), 's3.ssec');
     $stack->appendBuild(ApplyChecksumMiddleware::wrap(), 's3.checksum');
     $stack->appendBuild(Middleware::contentType(['PutObject', 'UploadPart']), 's3.content_type');
     $stack->appendBuild(AccelerateMiddleware::wrap($this->getConfig('use_accelerate_endpoint')), 's3.use_accelerate_endpoint');
     // Use the bucket style middleware when using a "bucket_endpoint" (for cnames)
     if ($this->getConfig('bucket_endpoint')) {
         $stack->appendBuild(BucketEndpointMiddleware::wrap(), 's3.bucket_endpoint');
     }
     $stack->appendSign(PutObjectUrlMiddleware::wrap(), 's3.put_object_url');
     $stack->appendSign(PermanentRedirectMiddleware::wrap(), 's3.permanent_redirect');
     $stack->appendInit(Middleware::sourceFile($this->getApi()), 's3.source_file');
     $stack->appendInit($this->getSaveAsParameter(), 's3.save_as');
     $stack->appendInit($this->getLocationConstraintMiddleware(), 's3.location');
     $stack->appendInit($this->getEncodingTypeMiddleware(), 's3.auto_encode');
     $stack->appendInit($this->getHeadObjectMiddleware(), 's3.head_object');
 }
Esempio n. 10
0
 public function __construct(array $args)
 {
     parent::__construct($args);
     $stack = $this->getHandlerList();
     $stack->appendBuild([__CLASS__, '_add_accept_header']);
 }
Esempio n. 11
0
 public function __construct(array $args)
 {
     parent::__construct($args);
     $this->getHandlerList()->appendInit($this->cleanIdFn(), 'route53.clean_id');
 }