12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- namespace Aws\MachineLearning;
- use Aws\AwsClient;
- use Aws\CommandInterface;
- use GuzzleHttp\Psr7\Uri;
- use Psr\Http\Message\RequestInterface;
- class MachineLearningClient extends AwsClient
- {
- public function __construct(array $config)
- {
- parent::__construct($config);
- $list = $this->getHandlerList();
- $list->appendBuild($this->predictEndpoint(), 'ml.predict_endpoint');
- }
-
- 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);
- };
- };
- }
- }
|