Файл: includes/library/aws/Aws/MachineLearning/MachineLearningClient.php
Строк: 65
<?php
namespace AwsMachineLearning;
use AwsAwsClient;
use AwsCommandInterface;
use GuzzleHttpPsr7Uri;
use PsrHttpMessageRequestInterface;
/**
* Amazon Machine Learning client.
*/
class MachineLearningClient extends AwsClient
{
public function __construct(array $config)
{
parent::__construct($config);
$list = $this->getHandlerList();
$list->appendBuild($this->predictEndpoint(), 'ml.predict_endpoint');
}
/**
* Changes the endpoint of the Predict operation to the provided endpoint.
*
* @return callable
*/
private function predictEndpoint()
{
return static function (callable $handler) {
return function (
CommandInterface $command,
RequestInterface $request = null
) use ($handler) {
if ($command->getName() === 'Predict') {
$request = $request->withUri(new Uri($command['PredictEndpoint']));
}
return $handler($command, $request);
};
};
}
}