private function resolveValue(array $param, Resource $resource, Command $command = null, ResultInterface $result = null) { switch ($param['source']) { // Source is pulled from the resource's identifier. case 'identifier': $id = $resource->getIdentity(); return isset($id[$param['name']]) ? $id[$param['name']] : null; // Source is pulled from the resource's data. // Source is pulled from the resource's data. case 'data': return jp\search($param['path'], $resource); // Source is pulled from the command parameters. // Source is pulled from the command parameters. case 'requestParameter': return $command[$param['path']]; // Source is pulled from the result. // Source is pulled from the result. case 'response': return $result ? $result->search($param['path']) : null; // Source is a literal value from the resource model. // Source is a literal value from the resource model. case 'string': case 'integer': case 'boolean': return $param['value']; // Invalid source type. // Invalid source type. default: throw new \InvalidArgumentException('The value "' . $param['source'] . '" is an invalid for source.'); } }
/** * Checks if a result response is an S3 pointer. * * @param \Aws\ResultInterface $result * The result from the SQS request. * * @return bool * TRUE if the result corresponds to an S3 pointer. FALSE otherwise. */ public static function isS3Pointer(ResultInterface $result) { // Check that the second element of the 2 position array has the expected // keys (and no more). return $result->count() == 2 && is_array($result->get(1)) && empty(array_diff($result->get(1), ['s3BucketName', 's3Key'])); }
protected function extractETag(ResultInterface $result) { return $result->search('CopyPartResult.ETag'); }
/** * {@inheritDoc} */ protected function wrapResult(ResultInterface $result = null) { return null === $result ? new AwsDynamoDbResult() : new AwsDynamoDbResult($result->toArray()); }