39 public function __construct(
string $projectKey, $body =
null, array $headers = [], ?ClientInterface $client =
null)
41 $uri = str_replace([
'{projectKey}'], [self::encodePathParam($projectKey)],
'{projectKey}/variants/bulk');
42 parent::__construct($client,
'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body);
77 public function execute(array $options = [], ?
string $resultType =
null)
80 $response = $this->
send($options);
81 }
catch (ServerException $e) {
82 $response = $e->getResponse();
83 $e = ExceptionFactory::createServerException($e, $this, $response, $this->
mapFromResponse($response, $resultType));
85 }
catch (ClientException $e) {
86 $response = $e->getResponse();
87 $e = ExceptionFactory::createClientException($e, $this, $response, $this->
mapFromResponse($response, $resultType));
100 public function executeAsync(array $options = [], ?
string $resultType =
null)
103 function (ResponseInterface $response) use ($resultType) {
106 function (RequestException $e) use ($resultType) {
107 $response = $e->getResponse();
108 if ($e instanceof ServerException) {
109 $e = ExceptionFactory::createServerException($e, $this, $response, $this->
mapFromResponse($response, $resultType));
111 if ($e instanceof ClientException) {
112 $e = ExceptionFactory::createClientException($e, $this, $response, $this->
mapFromResponse($response, $resultType));