Beispiel #1
0
 /**
  * @param callable $provider
  * @param string   $serviceName
  * @param string   $apiVersion
  *
  * @internal param array $definition Service description
  */
 public function __construct(callable $provider, $serviceName, $apiVersion)
 {
     static $defaults = ['operations' => [], 'shapes' => [], 'metadata' => []], $defaultMeta = ['serviceFullName' => null, 'apiVersion' => null, 'endpointPrefix' => null, 'signingName' => null, 'signatureVersion' => null, 'protocol' => null];
     $this->apiProvider = $provider;
     $this->serviceName = $serviceName;
     $this->apiVersion = $apiVersion;
     $definition = ApiProvider::resolve($provider, 'api', $serviceName, $apiVersion) + $defaults;
     $definition['metadata'] += $defaultMeta;
     parent::__construct($definition, new ShapeMap($definition['shapes']));
 }
Beispiel #2
0
 /**
  * @param array    $definition
  * @param callable $provider
  *
  * @internal param array $definition Service description
  */
 public function __construct(array $definition, callable $provider)
 {
     static $defaults = ['operations' => [], 'shapes' => [], 'metadata' => []], $defaultMeta = ['apiVersion' => null, 'serviceFullName' => null, 'endpointPrefix' => null, 'signingName' => null, 'signatureVersion' => null, 'protocol' => null];
     $definition += $defaults;
     $definition['metadata'] += $defaultMeta;
     $this->definition = $definition;
     $this->apiProvider = $provider;
     parent::__construct($definition, new ShapeMap($definition['shapes']));
     $this->serviceName = $this->getEndpointPrefix();
     $this->apiVersion = $this->getApiVersion();
 }