Пример #1
0
 public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value)
 {
     $this->fqname = $command->getName();
     $query = array();
     $this->customResolver($value, $param, $query, $param->getWireName());
     $request->addPostFields($query);
 }
Пример #2
0
 public function getClassName(CommandInterface $command)
 {
     $className = $command->getName();
     if (isset($this->map[$className])) {
         return $this->map[$className];
     } elseif (isset($this->map['*'])) {
         // If a wildcard was added, then always use that
         return $this->map['*'];
     }
     return null;
 }
Пример #3
0
 protected function getClassName(CommandInterface $command)
 {
     $iteratorName = $this->inflector->camel($command->getName()) . 'Iterator';
     // Determine the name of the class to load
     foreach ($this->namespaces as $namespace) {
         $potentialClassName = $namespace . '\\' . $iteratorName;
         if (class_exists($potentialClassName)) {
             return $potentialClassName;
         }
     }
     return false;
 }
Пример #4
0
 public function build(CommandInterface $command, array $options = array())
 {
     // Get the configuration data for the command
     $commandName = $command->getName();
     $commandSupported = isset($this->config[$commandName]);
     $options = $this->translateLegacyConfigOptions($options);
     $options += $commandSupported ? $this->config[$commandName] : array();
     // Instantiate the iterator using the primary factory (if one was provided)
     if ($this->primaryIteratorFactory && $this->primaryIteratorFactory->canBuild($command)) {
         $iterator = $this->primaryIteratorFactory->build($command, $options);
     } elseif (!$commandSupported) {
         throw new InvalidArgumentException("Iterator was not found for {$commandName}.");
     } else {
         // Instantiate a generic AWS resource iterator
         $iterator = new AwsResourceIterator($command, $options);
     }
     return $iterator;
 }